當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Controller::User方法代碼示例

本文整理匯總了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;
 }
開發者ID:bychems,項目名稱:projet-pfe,代碼行數:15,代碼來源:QuotationsController.php

示例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;
 }
開發者ID:bychems,項目名稱:projet-pfe,代碼行數:35,代碼來源:TestDrivesController.php

示例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';
     }
 }
開發者ID:bychems,項目名稱:projet-pfe,代碼行數:28,代碼來源:CustomersController.php

示例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]);
 }
開發者ID:bychems,項目名稱:projet-pfe,代碼行數:8,代碼來源:UsersController.php


注:本文中的App\Http\Controllers\Controller::User方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。