Laravel Fillable and Hidden

 Fillable 

Goto App->User.php

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

This means that name,email,password will only be added during insert query no matter 
other values added in the query.

 $data = [
        'name' => 'newname',
        'email' => 'emailn@mail.com',
        'password' => bcrypt('password23'),
        'mobile' => 656565666
    ];

    User::create($data);


Comments

Popular Posts