84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
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)