iam试图重写流明中的创建方法,我使用laravel中的完全相同的代码,并且像魅力一样工作,但是当我在流明中尝试它时,出现内存大小错误,这里是我的代码:流明中允许的内存大小错误
web.php:
$app->get('/test', function() {
User::create(['name'=>'a','email'=>'[email protected]']);
});
user.php的:
public static function create(array $attributes = [])
{
parent::create($attributes);
}
为y您可以同时看到这里没有什么特别,这里是完整的错误:
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in D:\gbarena\GBarena-Users\vendor\illuminate\database\Eloquent\Concerns\GuardsAttributes.php on line 176
顺便说一下,我试图增加允许的内存大小,以及注释和取消注释可填写阵列,但没有奏效....
尝试'** **回报父母 ::创建($属性)尝试;' - 我不知道,也不流明虽然laravel – Xatenev
@Xatenev想法没有伤心地工作 –
我觉得有代码的重要部分,你不分享 – apokryfos