Put it in a transaction and/or put a try..catch arround it.
DB::transaction(function()
{
//create user
//add roles
$user->roles()->attach(1);
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community