I want to insert foreign key when I will migration than add a foreign key value in 1
`public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->integer('role_id')->unsigned()->after('email')->nullable();
$table->foreign('role_id')->references('id')->on('roles');
});
$data = [
'name' => 'admin',
'email' => 'admin@admin.com',
'role_id' => 1,
'password' => bcrypt('123456'),
];
App\User::create($data);
}`
Here is screenshot of the users table