Created
September 14, 2019 23:28
-
-
Save brandonsueur/907b7899f9d29a9b439eb831865e8275 to your computer and use it in GitHub Desktop.
php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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