相关疑难解决方法(0)

LARAVEL如何从特质改变模型中的$ fillable?

我有模特:

use seoTrait;

protected $fillable = [
    'name', 'title', 'description'
];
Run Code Online (Sandbox Code Playgroud)

我在$ fillable中创建了需要"seoMeta"的特质"seoTrait".

现在我补充说:

protected $fillable = [
    'name', 'title', 'description', 'seoMeta'
];
Run Code Online (Sandbox Code Playgroud)

但是有可能在特质"seoTrait"中添加一些东西给$ fillable吗?

php laravel laravel-5 laravel-5.1

6
推荐指数
3
解决办法
4509
查看次数

标签 统计

laravel ×1

laravel-5 ×1

laravel-5.1 ×1

php ×1