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


PHP Company::create方法代码示例

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


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

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 30) as $index) {
         \App\Company::create(['name' => $faker->company()]);
     }
 }
开发者ID:fero,项目名称:teamsflare,代码行数:12,代码来源:CompaniesTableSeeder.php

示例2: 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();
     Company::create($input);
     return \Redirect::back()->with('message', 'İşletme Başarıyla Kaydedildi');
 }
开发者ID:karpuzkan,项目名称:laravel,代码行数:13,代码来源:CompanyController.php

示例3: run

 public function run()
 {
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 20; $i++) {
         \App\Company::create(['title' => $faker->unique()->company, 'address' => $faker->streetAddress, 'phone' => $faker->phoneNumber]);
     }
 }
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:7,代码来源:CompaniesSeeder.php

示例4: 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, $this->rules);
     $input = Input::all();
     $input['user_id'] = Auth::User()->id;
     Company::create($input);
     return Redirect::route('company.index')->with('Company created.');
 }
开发者ID:stoic1979,项目名称:laravel_trucks,代码行数:14,代码来源:CompanyController.php

示例5: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\UpdateAndSaveCompany $request, Company $company)
 {
     $company->create($request->all());
     \Session::flash('message', 'You have successfully Created ' . $company->name);
     $companies = Company::orderBy('name')->paginate(15);
     $keyword = '';
     return view('company.list', compact('companies', 'keyword'));
 }
开发者ID:keiwerkgvr,项目名称:salesperformanceindicator,代码行数:13,代码来源:TrainingController.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // unguard()メソッドは、EloquentのマスアサインメントをOFFにします。
     Model::unguard();
     //
     Company::create(['id' => 1, 'company_id' => 1, 'name' => '株式会社VApps', 'name_kana' => 'ぶいあっぷす']);
     Company::create(['id' => 2, 'company_id' => 2, 'name' => '株式会社PApps', 'name_kana' => 'ぴーあっぷす']);
     Company::create(['id' => 3, 'company_id' => 3, 'name' => '株式会社AApps', 'name_kana' => 'あーあっぷす']);
 }
开发者ID:sibukixxx,项目名称:Laravel5.SampleApplication,代码行数:14,代码来源:CompanySeeder.php

示例7: run

 public function run()
 {
     DB::table('companies')->truncate();
     Model::unguard();
     Company::create(['title' => 'Sika', 'short_title' => 'sika', 'file_main' => '1.jpg', 'file_logo' => '1.png']);
     Company::create(['title' => 'SFS intec', 'short_title' => 'sfs', 'file_main' => '2.jpg', 'file_logo' => '2.png']);
     Company::create(['title' => 'Праймер', 'short_title' => 'primer', 'file_main' => '3.jpg', 'file_logo' => '3.png']);
     Model::reguard();
 }
开发者ID:alexmon1989,项目名称:kadsgroup,代码行数:9,代码来源:CompaniesTableSeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 1; $i++) {
         $companyName = str_replace('-', ' ', $faker->unique()->company);
         $userName = str_replace([' ', ','], '', $companyName);
         $domain = $userName . $faker->randomElement(['.com', '.net', '.org']);
         Company::create(['status' => $faker->randomElement(['active', 'inactive']), 'name' => $companyName, 'website_name' => $companyName, 'slogan' => $faker->catchPhrase, 'logo' => '/img/pt-default/' . $faker->unique()->numberBetween(1, 330) . '.jpg', 'theme' => '', 'phone_number' => $faker->phoneNumber, 'cell_phone' => $faker->phoneNumber, 'address' => $faker->streetAddress, 'state' => $faker->state, 'city' => $faker->city, 'zip_code' => $faker->postcode, 'facebook' => $userName, 'google_plus' => $userName, 'facebook_app_id' => $faker->md5, 'twitter' => $userName, 'email' => 'info@' . $domain, 'contact_email' => 'contact@' . $domain, 'sales_email' => 'sales@' . $domain, 'support_email' => 'support@' . $domain, 'website' => 'http://' . $domain, 'description' => $faker->text(200), 'keywords' => implode(',', $faker->words(20)), 'about_us' => $faker->text(1200), 'refund_policy' => trans('law.refund'), 'privacy_policy' => trans('law.privacy'), 'terms_of_service' => trans('law.terms'), 'google_maps_key_api' => 'AIzaSyCutQnEgrqX8W2X-nBCYB7-CbsTC-LlRMw']);
     }
 }
开发者ID:softsolution,项目名称:antVel,代码行数:15,代码来源:CompanyTableSeeder.php

示例9: create

 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $newUser = ['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'user_type' => $data['user_type'], 'phone' => $data['phone']];
     $user = User::create($newUser);
     // SE É EMPRESA CRIAR TAMBÉM UM REGISTRO NA TABELA COMPANY
     if ($data['user_type'] == 'COMPANY') {
         Company::create(['id_user' => $user->id_user, 'cnpj' => ${$data}['cnpj']]);
     }
     return $user;
 }
开发者ID:sandrovw64,项目名称:comanda-teste,代码行数:16,代码来源:AuthController.php

示例10: store

 public function store()
 {
     $input = \Input::all();
     $input['company']['user_id'] = \Auth::user()->id;
     $v = \Validator::make($input['company'], \App\Company::$createRules);
     if ($v->fails()) {
         return \Redirect::route('companies.create')->withErrors($v->errors())->withInput();
     }
     $company = \App\Company::create($input['company']);
     return \Redirect::route('companies.show', ['company' => $company]);
 }
开发者ID:bhargavjoshi,项目名称:timesheet,代码行数:11,代码来源:CompaniesController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $friendly_url = $this->setFriendlyUrl($request->input('name'));
     // if has file
     if ($request->hasFile('image')) {
         $image_name = $this->uploadImage($request->file('image'), 'companies', $friendly_url);
     } else {
         $image_name = "none.jpg";
     }
     Company::create(['name' => $request->input('name'), 'friendly_url' => $friendly_url, 'image' => $image_name, 'description' => $request->input('description'), 'phone' => $request->input('phone'), 'web' => $request->input('web'), 'email' => $request->input('email'), 'status' => $request->input('status')]);
     Session::flash('message', 'Compañía agregada con éxito');
     return redirect('companies');
 }
开发者ID:lautaruni,项目名称:billboard,代码行数:19,代码来源:CompanyController.php

示例12: saveData

 private static function saveData($data)
 {
     // find company by business_id
     $company = Company::where('business_id', $data->businessId)->first();
     $company_data = ['business_id' => $data->businessId, 'name' => $data->name, 'company_form' => $data->companyForm, 'registration_date' => $data->registrationDate];
     if (is_null($company)) {
         // if company not found -> create
         $company = Company::create($company_data);
         $addedCompanies[] = $company->businessId;
     } else {
         // if compnay exists -> update
         $company->update($company_data);
     }
     return $addedCompanies;
 }
开发者ID:villeglad,项目名称:comex,代码行数:15,代码来源:Company.php

示例13: postRegisterCompany

 public function postRegisterCompany(Request $request)
 {
     $validator = Validator::make($request->except("__token"), ["name" => "required", "email" => "required|email", "tin" => "required", "vrn" => "required", "box" => "required", "address" => "required", "phone" => "required", "logo" => "required|image", "password" => "required|confirmed", "password_confirmation" => "required"]);
     if ($validator->passes()) {
         $data = $request->all();
         //registering the company/adding to db
         $company = Company::create(["name" => $data['name'], "tin" => $data['tin'], "box" => $data['box'], "address" => $data['address'], "phone" => $data['phone'], "logo" => $data['logo'], "vrn" => $data['vrn'], "email" => $data['email'], "status" => "pending"]);
         $user = User::create(["email" => $data['email'], "password" => Hash::make($data["password"]), "name" => $data["name"], "company_id" => $company->id]);
         $role = Role::find(4);
         $user->attachRole($role);
         $log = Auth::login($user);
         if ($log) {
             return Redirect::to("/")->with("success", "You are Now Registered and Logged In! \n please wait for Confirmation Email before you can access full system");
         }
     } else {
         return Redirect::back()->withErrors($validator)->withInput();
     }
 }
开发者ID:younggeeks,项目名称:twentyKitonga,代码行数:18,代码来源:CompanyController.php

示例14: postAdd

 public function postAdd(Request $request)
 {
     try {
         $this->validate($request, ['cif' => 'required', 'name' => 'required']);
         $input = $request->all();
         $company = Company::create($input);
         $company->save();
         if ($request->clients) {
             $company->clients()->sync($request->clients);
         }
         if ($request->providers) {
             $company->providers()->sync($request->providers);
         }
         Session::flash('ok_message', 'Company successfully added!');
         return redirect()->route('admin.companies.index');
     } catch (\Exception $e) {
         Session::flash('error_message', 'Error adding company');
         return redirect()->back();
     }
 }
开发者ID:rtorralba,项目名称:companies,代码行数:20,代码来源:CompanyController.php

示例15: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\UpdateAndSaveCompany $request, Company $company)
 {
     $request->offsetSet('created_by', Auth::user()->id);
     $request->offsetSet('updated_by', Auth::user()->id);
     $request->offsetSet('status', 'ACTIVE');
     $company->create($request->all());
     $company = DB::table('companies')->where('name', $request->name)->first();
     $password = $request->password;
     $user = new User();
     $request->offsetSet('password', bcrypt($request->password));
     $request->offsetSet('created_by', Auth::user()->id);
     $request->offsetSet('updated_by', Auth::user()->id);
     $request->offsetSet('status', "NEW");
     $request->offsetSet('role_id', "4");
     $request->offsetSet('manager_id', 0);
     $request->offsetSet('company_id', $company->id);
     $user->create($request->all());
     $user = DB::table('users')->where('email', $request->email)->first();
     $goal = parent::assembleGoalSetting();
     $goal->user_id = $user->id;
     $goal->created_by = Auth::user()->id;
     $goal->updated_by = Auth::user()->id;
     $goal->save();
     $userPassword = new UserPassword();
     $userPassword->user_id = $user->id;
     $userPassword->crypt_password = \Crypt::encrypt($password);
     $userPassword->updated_at = new \DateTime();
     $userPassword->created_at = new \DateTime();
     $userPassword->save();
     $contactEmail = $user->email;
     $contactName = $user->first_name . ' ' . $user->last_name;
     Mail::send('emails.hello', array('first_name' => $user->first_name, 'user_name' => $user->email, 'password' => $password), function ($message) use($contactEmail, $contactName) {
         $message->from('no-reply@salesperformanceindicator.com', 'Sales Performance Indicator');
         $message->to($contactEmail, $contactName)->subject('Welcome to Sales Performance Indicator!');
     });
     \Session::flash('message', 'You have successfully Created ' . $company->name);
     $companies = Company::orderBy('name')->paginate(15);
     $keyword = '';
     return view('company.list', compact('companies', 'keyword'));
 }
开发者ID:villar88,项目名称:salesperformanceindicator,代码行数:45,代码来源:CompanyController.php


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