【发布时间】:2016-12-13 23:57:00
【问题描述】:
我的控制器中有以下方法:
public function store(Request $request){
$data = session()->get('dmca');
// return $data;
$notice = Notice::open($date);
$notice->useTemplate($request->input('template'));
$notice->save();
return Notice::first();
}
控制器运行时出现以下错误:
现在我确实有以下模态类:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Notice extends Model {
protected $fillable = [
'provider_id',
'infringing_title',
'infringing_link',
'original_link',
'original_description',
'template',
'content_removed'
];
public static function open(array $attributes) {
return new static($attributes);
}
public function useTemplate($template) {
$this->template = $template;
}
}
现在为什么我在 laravel class not found 中遇到这个错误,即使我已经定义了这个类??
【问题讨论】: