I am doing a project with laravel. And I am using Cartalyst-Sentinel with it. How can I add slug from first_name+last_name in users table from database
I added slug for "roles" table but I don't know How can I add values in "slug" columns in the "users" table by adding first_name and last_name. ex: first_name= "JOHN", last_name="CENA", slug="JOHN-CENA"
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('email');
$table->string('password');
$table->string('birthday')->nullable();
$table->string('gender')->nullable();
$table->text('permissions')->nullable();
$table->timestamp('last_login')->nullable();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('slug');
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('email');
$table->unique('slug');
});
DB::table('roles')->insert(array(
array('id'=>1, 'slug'=> 'admin', 'name'=> 'Admin', 'permissions'=> NULL),
array('id'=>2, 'slug'=> 'user', 'name'=> 'User', 'permissions'=> NULL)
)
);