I put the Models file under AppModels
认证高级PHP讲师
It must be written completely. When this code is actually parsed, it will not be clear where the Class you specified is, so you have to write the complete namespace
Class
->belongsTo('AppModelsGroup', 'uid', 'gid')
or
->belongsTo(AppModelsGroup::class, 'uid', 'gid')
Check whether your space name path is the same as your current path
Add
namespace App\Models;
It must be written completely. When this code is actually parsed, it will not be clear where the
Class
you specified is, so you have to write the complete namespace->belongsTo('AppModelsGroup', 'uid', 'gid')
or
->belongsTo(AppModelsGroup::class, 'uid', 'gid')
Check whether your space name path is the same as your current path
Add
to the beginning of the file in the current screenshot (the next line of <?php)