当前位置: 首页>>代码示例>>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;未经允许,请勿转载。