我创建了一个建筑模型和资源,我通过下面的方法来完成。
php artisan make:model Building -m
php artisan nova:resource Building
我创建了我的迁移,并正常工作,但我也需要建筑类型,所以我创建了以下。
php artisan make:model BuidlingType -m
php artisan nova:resource BuildingType
但当我想访问仪表板时,我得到一个错误。
Class 'App\BuildingType' not found (View: /Users/Username/projects/enest/vendor/laravel/nova/resources/views/layout.blade.php)```
你可以在资源中修正模型。
/**
* The model the resource corresponds to.
*
* @var string
*/
public static $model = 'App\BuidlingType';