Laravel Nova App/Model在创建资源后没有找到.

问题描述 投票:0回答:1

我创建了一个建筑模型和资源,我通过下面的方法来完成。

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)```

laravel eloquent laravel-nova laravel-migrations
1个回答
0
投票

你可以在资源中修正模型。

/**
 * The model the resource corresponds to.
 *
 * @var string
 */
public static $model = 'App\BuidlingType';

https:/nova.laravel.comdocs2.0resources#defining-resources。

© www.soinside.com 2019 - 2024. All rights reserved.