本文整理匯總了PHP中App\Http\Controllers\Controller::User方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller::User方法的具體用法?PHP Controller::User怎麽用?PHP Controller::User使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類App\Http\Controllers\Controller
的用法示例。
在下文中一共展示了Controller::User方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addcustomerfirst
public function addcustomerfirst($name, $last_name, $cin, $mail, $adress, $function, $phone, $car)
{
$customer = new Customer();
$customer->name = $name;
$customer->last_name = $last_name;
$customer->cin = $cin;
$customer->mail = $mail;
$customer->adress = $adress;
$customer->function = $function;
$customer->phone = $phone;
$customer->car = $car;
$customer->commercial_id = Controller::User()->id;
$customer->save();
return $customer;
}
示例2: showHours
public function showHours($date, $car)
{
$row = TestDriveDay::IdDate($date, $car)->get();
//dd($row);
$id = $row[0]->id;
$hours = TestDriveHour::ListHeureIndispo($id)->get();
//dd($hours);
$in = array();
foreach ($hours as $hour) {
$cust = Customer::find($hour->customer_id);
$in['h'] = $hour->hour;
if ($hour->customer_id == 1) {
$in['state'] = 'false';
$in['annuler'] = 'false';
} else {
$in['state'] = 'true';
if ($cust->commercial_id == Controller::User()->id) {
$in['annuler'] = 'true';
$in['attach_id'] = $cust->id;
$in['attach_name'] = $cust->name;
$in['line'] = 'Pour';
$in['id_hour'] = $hour->id;
} else {
$in['annuler'] = 'false';
$in['attach_id'] = $cust->commercial_id;
$in['attach_name'] = User::find($cust->commercial_id)->name;
$in['line'] = 'Par';
}
}
$in['id'] = $id;
$re[$hour->id] = $in;
}
$re = json_encode($re);
return $re;
}
示例3: storeOffline
public function storeOffline(Request $request)
{
//--ADD NEW CUSTOMER
// $user::Auth
// dd($request);
$cust = json_decode($request->hidden_customer, false);
$testCin = Customer::GetCinCustomer($cust->cin)->get();
if (!isset($testCin[0])) {
$customer = new Customer();
$customer->name = $cust->name;
$customer->last_name = $cust->last_name;
$customer->cin = $cust->cin;
$customer->mail = $cust->mail;
$customer->adress = $cust->adress;
$customer->function = $cust->function;
$customer->phone = $cust->phone;
$customer->car = $cust->car;
$customer->commercial_id = Controller::User()->id;
$customer->save();
//Customer::firstOrCreate(['cin' => $cust->cin]);
//$newCustomer =
// attacher client au commercial courant
//$newCustomer->attachUser($user);
return 'true';
} else {
return 'false';
}
}
示例4: parametres
public function parametres()
{
$title = 'Paraétres généraux du compte';
$nom_prenom = Controller::User()->name;
$email = Controller::User()->email;
$phone = Controller::User()->phone;
return view('Users.parametres', ['title' => $title, 'nom_prenom' => $nom_prenom, 'email' => $email, 'phone' => $phone]);
}