本文整理汇总了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]);
}