当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::create方法代码示例

本文整理汇总了PHP中app\models\Client::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::create方法的具体用法?PHP Client::create怎么用?PHP Client::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Client的用法示例。


在下文中一共展示了Client::create方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Handle the command.
  *
  * @param  CreateClientCommand  $command
  * @return void
  */
 public function handle(CreateClientCommand $command)
 {
     $client = Client::create(['name' => $command->name, 'pay' => $command->pay, 'due' => $command->due]);
     if (!empty($client)) {
         return $client;
     }
     return false;
 }
开发者ID:nq2916,项目名称:savings,代码行数:14,代码来源:CreateClientCommandHandler.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @return \Illuminate\Http\Response
  */
 public function store(ClientRequest $request)
 {
     // Check authorisation and throw 404 if not
     if (!$this->authorised('create')) {
         return view('errors.404');
     }
     $client_request = $request->except('tabs');
     // Create Client
     Client::create($client_request);
     Toastr::success("Created new client", "Success");
     return view('client.list');
 }
开发者ID:unclefudge,项目名称:whs,代码行数:17,代码来源:ClientController.php

示例3: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $faker = Faker\Factory::create();
     $company = Company::create();
     $account = Account::create(['name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => Country::all()->random()->id, 'account_key' => str_random(RANDOM_KEY_LENGTH), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'work_phone' => $faker->phoneNumber, 'work_email' => $faker->safeEmail, 'invoice_design_id' => InvoiceDesign::where('id', '<', CUSTOM_DESIGN)->get()->random()->id, 'header_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17), 'primary_color' => $faker->hexcolor, 'timezone_id' => 1, 'company_id' => $company->id]);
     $user = User::create(['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'email' => TEST_USERNAME, 'username' => TEST_USERNAME, 'account_id' => $account->id, 'password' => Hash::make(TEST_PASSWORD), 'registered' => true, 'confirmed' => true, 'notify_sent' => false, 'notify_paid' => false, 'is_admin' => 1]);
     $client = Client::create(['user_id' => $user->id, 'account_id' => $account->id, 'public_id' => 1, 'name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => DEFAULT_COUNTRY, 'currency_id' => DEFAULT_CURRENCY]);
     Contact::create(['user_id' => $user->id, 'account_id' => $account->id, 'client_id' => $client->id, 'public_id' => 1, 'email' => env('TEST_EMAIL', TEST_USERNAME), 'is_primary' => true]);
     Product::create(['user_id' => $user->id, 'account_id' => $account->id, 'public_id' => 1, 'product_key' => 'ITEM', 'notes' => 'Something nice...', 'cost' => 10]);
     Affiliate::create(['affiliate_key' => SELF_HOST_AFFILIATE_KEY]);
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:13,代码来源:UserTableSeeder.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request $request
  * @return Response
  */
 public function store(Client $table, Request $request)
 {
     $inputs = \Input::except('_token', 'client_logo');
     foreach ($inputs as $k => $v) {
         if (is_array($v)) {
             $inputs[$k] = json_encode($v);
         }
     }
     $table->validate($request, $table->rules());
     $client = $table->create($inputs);
     if ($request->hasFile('client_logo')) {
         $table->uploadFile($request->file("client_logo"), $client->id);
     }
     $notification[] = array('type' => 'success', 'message' => \Lang::get('notification.store_success'));
     \Session::flash('notification', $notification);
     return redirect('client');
 }
开发者ID:satyams13,项目名称:Sample-Code-L5,代码行数:23,代码来源:ClientController.php

示例5: store

 public function store(CreateClientRequest $request, Client $client)
 {
     $client->create($request->all());
     return redirect()->route('clients.index');
 }
开发者ID:berkapavel,项目名称:Laravel5-Time-Tracker-Project-manager,代码行数:5,代码来源:ClientsController.php

示例6: create

 public function create($requestData)
 {
     Client::create($requestData);
 }
开发者ID:Bottelet,项目名称:Flarepoint-crm,代码行数:4,代码来源:ClientRepository.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(ClientStoreRequest $request)
 {
     $this->data->client = Client::create($request->all());
     return $this->json();
 }
开发者ID:alfrecuellar,项目名称:muebles,代码行数:10,代码来源:ClientController.php

示例8: create

 public function create($requestData)
 {
     $client = Client::create($requestData);
     Session()->flash('flash_message', 'Client successfully added');
     event(new \App\Events\ClientAction($client, self::CREATED));
 }
开发者ID:bottelet,项目名称:flarepoint,代码行数:6,代码来源:ClientRepository.php

示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('clients')->delete();
     $testmodpack = Client::create(array('name' => 'TestClient', 'uuid' => '2ezf6f26-eb15-4ccb-9f0b-8z5ed2c72946'));
 }
开发者ID:Lord-Ptolemy,项目名称:LumenSolder,代码行数:10,代码来源:ClientTableTestSeeder.php

示例10: setup

 /**
  * Setup
  */
 public function setup()
 {
     echo "<h1>Setup</h1>";
     DB::table('z_lookup_company')->truncate();
     // Create System, Open Hands + Cape Cod Companies
     $sys = Company::create(array('name' => 'System', 'email' => 'system@openhands.com.au', 'status' => '1', 'subscription' => '9', 'created_by' => '1', 'updated_by' => '1', 'parent_company' => '0'));
     $oh = Company::create(array('name' => 'Open Hands', 'email' => 'fudge@openhands.com.au', 'phone' => '0414 849 091', 'address' => '1438 South Arm Rd', 'suburb' => 'Clifton Beach', 'state' => 'TAS', 'postcode' => '7020', 'status' => '1', 'subscription' => '9', 'created_by' => '1', 'updated_by' => '1', 'parent_company' => '0'));
     $cc = Company::create(array('name' => 'Cape Cod', 'email' => 'office@capecod.com.au', 'phone' => '(02) 9849 4444', 'address' => '4th Floor, 410 Church St', 'suburb' => 'Parramatta', 'state' => 'NSW', 'postcode' => '2151', 'status' => '1', 'subscription' => '3', 'created_by' => '1', 'updated_by' => '1', 'parent_company' => '0'));
     zLookupCompany::create(array('old' => '12', 'new' => '3'));
     echo "Created companies System, Open Hands + Cape Cod<br>";
     // Attach Role "Super Admin"
     // Create User System
     $system = User::create(array('username' => 'system', 'email' => 'system@openhands.com.au', 'password' => '$2y$10$QejRefLCIU.vXgO.R5x3xOhu5NN7zyAPkofU6DZSrpLvwVrgWfOce', 'firstname' => 'System', 'company_id' => '1', 'status' => '1', 'created_by' => '1', 'updated_by' => '1'));
     // Create Admin System
     $admin = User::create(array('username' => 'admin', 'email' => 'fudge@openhands.com.au', 'password' => '$2y$10$QejRefLCIU.vXgO.R5x3xOhu5NN7zyAPkofU6DZSrpLvwVrgWfOce', 'firstname' => 'Fudge', 'lastname' => 'Jordan', 'phone' => '0414 849 091', 'address' => '1438 South Arm Rd', 'suburb' => 'Clifton Beach', 'state' => 'TAS', 'postcode' => '7020', 'photo' => '', 'company_id' => '2', 'status' => '1', 'created_by' => '1', 'updated_by' => '1'));
     //$admin = User::find(1);
     $admin->attachRole(1);
     // Create User Fudge
     $fudge = User::create(array('username' => 'fudge', 'email' => 'fudge@jordan.net.au', 'password' => '$2y$10$QejRefLCIU.vXgO.R5x3xOhu5NN7zyAPkofU6DZSrpLvwVrgWfOce', 'firstname' => 'Fudge', 'lastname' => 'Jordan', 'phone' => '0414 849 091', 'address' => '1438 South Arm Rd', 'suburb' => 'Clifton Beach', 'state' => 'TAS', 'postcode' => '7020', 'photo' => 'filebank/users/2/photo.jpg', 'company_id' => '3', 'status' => '1', 'created_by' => '1', 'updated_by' => '1'));
     $fudge->attachRole(2);
     echo "Created users Admin + Fudge<br>";
     // Create Default Client
     $client1 = Client::create(array('name' => 'Unassigned Client', 'phone' => 'phone', 'address' => 'address', 'suburb' => 'suburb', 'state' => 'NSW', 'postcode' => 'postcode', 'company_id' => '3', 'status' => '1', 'created_by' => '1', 'updated_by' => '1'));
     echo "Created default client<br>";
 }
开发者ID:unclefudge,项目名称:whs,代码行数:28,代码来源:MigrationController.php


注:本文中的app\models\Client::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。