In the process of learning Laravel and following along with the video tutorials. During episode 11 @ 18 minutes 30 seconds in here.
protected $guarded = [];
This allows him to define all the guarded fields in the new Model.php when doing a mass submission in his form. However when I fo this I still get a mass assignment exception.
If I change the Model.php to Models.php (notice the extra 's') then it works. I'm wondering why I can't have another file name Model.php inside the app directory to extend to?
<?php
namespace App;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Model extends Eloquent
{
protected $guarded = [];
}
You are going to have to use the App\Model; Instead of the use Illuminate\Database\Eloquent\Model;