Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
php
<?php
protected function create(array $data)
{
$user = User::create([
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'username' => strtolower($data['first_name'] . $data['last_name']),
'phone' => $data['phone'],
'email' => $data['email'],
'verified' => false,
'role' => 'admin',
'user_type' => 'carrier',
'password' => Hash::make($data['password']),
]);
\LogActivity::addToLog('user(carrier):created');
Company::create([
'boss_id' => $user->id,
'name' => $data['name'],
'siret' => $data['siret'],
'address' => $data['address'],
'legal_redress' => $data['legal_redress'],
'customer_reference' => $data['customer_reference'],
'judicial_liquidation' => $data['judicial_liquidation'],
'turnover' => $data['turnover'],
'net_profit' => $data['net_profit'],
'employees_count' => $data['employees_count'],
'insurance_document' => "toto",
]);
return redirect()
->action('UsersController@show')
->with('success', "Votre compte a bien été créé")
->with('warning', "Le compte vous sera validé sous 24 heures ouvrées");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.