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


PHP Client::create方法代碼示例

本文整理匯總了PHP中app\Client::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::create方法的具體用法?PHP Client::create怎麽用?PHP Client::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Client的用法示例。


在下文中一共展示了Client::create方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('clients')->truncate();
     //insert some dummy records
     Client::create(['name' => 'Idea7', 'country' => 'IN', 'status' => 'active']);
     Client::create(['name' => 'Sunpharma', 'country' => 'IN', 'status' => 'active']);
 }
開發者ID:komalsavla10,項目名稱:timesheet,代碼行數:12,代碼來源:ClientTableSeeder.php

示例2: store

 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required', 'birth' => 'required', 'address' => 'required', 'phone' => 'required']);
     $request['created_at'] = Carbon::now();
     Client::create($request->all());
     return view('client.new')->with('success', 'Cliente cadastrado com sucesso!');
 }
開發者ID:Bryzola,項目名稱:hiring,代碼行數:7,代碼來源:ClientController.php

示例3: handleAction

 public function handleAction(Request $request)
 {
     $action = $request->input('_action');
     if ($action == 'createClient') {
         //Creation :
         Client::create($request->all());
         // FLash messaging :
         flash()->success('Opération réussie!', 'Client créé avec succès.');
     } else {
         if ($_POST['_action'] == 'getClientByID') {
             $id = $_POST['_uid'];
             $client = Client::where('id', $id)->with('files')->first();
             return response(['status' => 'success', 'client' => $client], 200);
         } else {
             if ($_POST['_action'] == 'editClient') {
                 $id = $_POST['id'];
                 $client = Client::find($id);
                 $client->lastname = $_POST['lastname'];
                 $client->firstname = $_POST['firstname'];
                 $client->email = $_POST['email'];
                 $client->street = $_POST['street'];
                 $client->postal_code = $_POST['postal_code'];
                 $client->city = $_POST['city'];
                 $client->vat = $_POST['tva'];
                 $client->mobile = $_POST['mobile'];
                 $client->office = $_POST['office'];
                 $client->fax = $_POST['fax'];
                 $client->save();
                 flash()->success('Opération réussie!', 'Client modifé avec succès.');
             } else {
             }
         }
     }
     return redirect('/clients');
 }
開發者ID:ninir007,項目名稱:Ats,代碼行數:35,代碼來源:ClientsController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $input = Input::all();
     $this->validate($request, ['Name' => 'required|string', 'PhoneNo' => 'required|digits:11', 'Address' => 'required', 'Email' => 'email']);
     Client::create($input);
     return Redirect::route('clients.index')->with('message', 'Client created');
 }
開發者ID:redcatthethird,項目名稱:garage-manager,代碼行數:13,代碼來源:ClientsController.php

示例5: run

 public function run()
 {
     $client = Client::create(['name' => 'Exhibit Partners', 'address' => '7700 68th Ave N', 'city' => 'Minneapolis', 'state' => 'MN', 'zip' => '55428']);
     User::create(['name' => 'Bill Gench', 'email' => 'bill@exhibitpartners.com', 'client_id' => $client->id, 'password' => bcrypt('trms'), 'is_admin' => true]);
     User::create(['name' => 'Seth Phillips', 'email' => 'seth.phillips@trms.com', 'client_id' => $client->id, 'password' => bcrypt('trms'), 'is_admin' => true]);
     User::create(['name' => 'Debs Holloway', 'email' => 'DebS@exhibitpartners.com', 'client_id' => $client->id, 'password' => bcrypt('trms'), 'is_admin' => true]);
 }
開發者ID:sethphillips,項目名稱:event_mailer,代碼行數:7,代碼來源:DatabaseSeeder.php

示例6: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|string|max:255', 'tax_number' => 'string|max:255|unique:clients', 'street' => 'string|max:255', 'city' => 'string|max:255', 'postal_code' => 'integer']);
     $client = Client::create(['name' => $request->get('name'), 'tax_number' => $request->get('tax_number'), 'street' => $request->get('street'), 'city' => $request->get('city'), 'postal_code' => $request->get('postal_code')]);
     flash()->success('Client created!');
     return redirect()->route('clients.index');
 }
開發者ID:laravelista,項目名稱:kyle,代碼行數:13,代碼來源:ClientController.php

示例7: store

 public function store(ClientRequest $request)
 {
     Client::create($request->all());
     //AFTER the row is added, get the last record to pass to the next page.
     $client = Client::latest()->first();
     \Session::flash('flash_message', 'Client ' . $client->first_name . ' ' . $client->last_name . ' was created.');
     return redirect('clients');
 }
開發者ID:patrykszady,項目名稱:gstest,代碼行數:8,代碼來源:ClientsController.php

示例8: create

 /**
  * create client
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function create(Request $request)
 {
     //validation
     $this->validation($request);
     //insert client
     $client = Client::create(['name' => $request->get('name'), 'gender' => $request->get('gender')]);
     return response()->json(['id' => $client->id]);
 }
開發者ID:kamalludinega,項目名稱:test,代碼行數:13,代碼來源:ClientController.php

示例9: store

 public function store(Request $request)
 {
     $currentPage = 'cocinas';
     $pedido = new KitchenRequest($request->input('pedido'));
     $pedido->secciones = $request->input('secciones');
     Client::create($request->input('cliente'))->kitchenRequests()->save($pedido);
     return view('pages.cocinasCreate', ['posted' => true] + compact('currentPage'));
 }
開發者ID:jorgeneira,項目名稱:unal-tienda-remote,代碼行數:8,代碼來源:CocinasController.php

示例10: store

 public function store(StoreColdRoomRequest $request)
 {
     $cliente = $request->input('cliente');
     $pedido = $request->input('pedido');
     $currentPage = 'cuartos';
     Client::create($cliente)->coldRoomRequests()->create($pedido);
     return view('pages.cuartosCreate', ['posted' => true] + compact('currentPage'));
 }
開發者ID:jorgeneira,項目名稱:unal-tienda-remote,代碼行數:8,代碼來源:CuartosController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $clientRequest)
 {
     $this->validate($clientRequest, ['first_name' => 'required', 'last_name' => 'required', 'company_name' => 'required', 'email' => 'required', 'address' => '', 'zipcode' => '', 'city' => '', 'primary_number' => '', 'secondary_number' => '', 'industry' => '', 'company_type' => '', 'fk_user_id' => 'required']);
     $input = $clientRequest->all();
     Client::create($input);
     //dd($input);
     Session::flash('flash_message', 'Client successfully added!');
     return redirect()->route('clients.index');
 }
開發者ID:tykus,項目名稱:RockCRM,代碼行數:14,代碼來源:ClientsController.php

示例12: store

 /**
  * Store a newly created resource in storage.
  * POST: /client.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required', 'email' => 'required|email', 'website' => 'url']);
     $input = $request->all();
     $client = Client::create($input);
     $client->save();
     Session::flash('success', 'Client successfully added.');
     return Redirect::route('client.index');
 }
開發者ID:xchub,項目名稱:web-freelancer,代碼行數:15,代碼來源:ClientsController.php

示例13: handle

 /**
  * Handle the command.
  *
  * @param  CreateClientUserCommand  $command
  * @return void
  */
 public function handle(CreateClientUserCommand $command)
 {
     //If photo uploaded correctly
     //Create user and client in DB
     DB::transaction(function () use($command) {
         $user = User::create(['email' => $command->email, 'password' => $command->password]);
         $client = Client::create(['profile_photo' => $command->profile_photo, 'first_name' => $command->first_name, 'last_name' => $command->last_name, 'user_id' => $user->id, 'email' => $command->email, 'phone_1' => $command->phone_1, 'phone_2' => $command->phone_2, 'address_1' => $command->address_1, 'address_2' => $command->address_2, 'city' => $command->city, 'state' => $command->state, 'zip' => $command->zip]);
     });
 }
開發者ID:2dan-devs,項目名稱:williamnavasphoto,代碼行數:15,代碼來源:CreateClientUserCommandHandler.php

示例14: create

 function create()
 {
     $client = array('name' => Input::get('ad'), 'last_name' => Input::get('soyad'), 'email' => Input::get('email'), 'tel' => Input::get('tel'), 'app_date' => Input::get('randevuTarihi'), 'hour_id' => Input::get('saat'), 'message' => Input::get('mesaj'));
     $create = Client::create($client);
     if ($create) {
         $_SESSION['mesaj'] = '<div class="form-signin" style="background-color:pink;"><center><p style="color:green;">Bilgileriniz alındı en yakın zamanda size döneceğiz.</p></center></div>';
     } else {
         $_SESSION['mesaj'] = '<div class="form-signin" style="background-color:pink;"><center><p style="color:green;">Hata Oluştu.</p></center></div>';
     }
     return Redirect::to('e-randevu');
 }
開發者ID:ufukpalavar52,項目名稱:laravel-php-projelerim,代碼行數:11,代碼來源:ClientsController.php

示例15: store

 public function store(ClientRequest $request)
 {
     if (Auth::check()) {
         $userId = Auth::user()->id;
     }
     $client = Client::create(['name' => $request['name'], 'creator_user_id' => $userId]);
     $userOrganisationRole = UserOrganisationRole::find($userId);
     $organisationClient = OrganisationsClients::create(['organisation_id' => $userOrganisationRole->organisation_id, 'client_id' => $client->id]);
     $organisationClient->clients()->save($client);
     return redirect('clients/create');
 }
開發者ID:vhinmanansala,項目名稱:Eloquent,代碼行數:11,代碼來源:ClientsController.php


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