Exemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 30) as $index) {
         \App\Company::create(['name' => $faker->company()]);
     }
 }
Exemplo n.º 2
0
 /**
  * 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');
 }
Exemplo n.º 3
0
 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]);
     }
 }
 /**
  * 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.');
 }
 /**
  * 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'));
 }
 /**
  * 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' => 'あーあっぷす']);
 }
 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();
 }
Exemplo n.º 8
0
 /**
  * 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']);
     }
 }
Exemplo n.º 9
0
 /**
  * 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;
 }
Exemplo n.º 10
0
 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]);
 }
Exemplo n.º 11
0
 /**
  * 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');
 }
Exemplo n.º 12
0
 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;
 }
Exemplo n.º 13
0
 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();
     }
 }
Exemplo n.º 14
0
 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();
     }
 }
 /**
  * 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('*****@*****.**', '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'));
 }
Exemplo n.º 16
0
 public function fetchAllCompaniesFromYtj()
 {
     for ($i = 0; $i < 350000; $i = $i + 1000) {
         $url = 'http://avoindata.prh.fi:80/tr/v1?totalResults=true&maxResults=1000&resultsFrom=' . $i . '&companyRegistrationFrom=1800-01-01';
         $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_USERAGENT, $agent);
         $result = curl_exec($ch);
         curl_close($ch);
         $resultObject = json_decode($result);
         foreach ($resultObject->results as $co) {
             $company = Company::create(['business_id' => $co->businessId, 'name' => $co->name, 'company_form' => $co->companyForm, 'registration_date' => $co->registrationDate]);
         }
     }
     //dd(json_decode($result));
 }
Exemplo n.º 17
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     Company::create(['name' => 'AntVel', 'website_name' => 'AntVel eCommerse', 'slogan' => 'An eCommerce out of the box', 'logo' => '/img/pt-default/' . $faker->unique()->numberBetween(1, 330) . '.jpg', 'phone_number' => $faker->phoneNumber, 'cell_phone' => $faker->phoneNumber, 'address' => $faker->streetAddress, 'state' => $faker->state, 'city' => $faker->city, 'zip_code' => $faker->postcode, 'facebook' => 'AntVel', 'facebook_app_id' => $faker->md5, 'twitter' => 'AntVel', 'contact_email' => '*****@*****.**', 'sales_email' => '*****@*****.**', 'support_email' => '*****@*****.**', 'website' => 'http://antvel.com', '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']);
 }
Exemplo n.º 18
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['store_name' => 'required|max:255']);
     $company = Company::create(['store_name' => $request->store_name, 'billing_country' => $request->billing_country, 'legal_entity_name' => $request->legal_entity_name, 'legal_entity_tax_register' => $request->legal_entity_tax_register]);
     return redirect('/company')->with('message', 'Company added!');
 }
Exemplo n.º 19
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Company::create(['name' => 'Dexperts', 'address' => 'Adamskamp 10', 'zipcode' => '6576 EG', 'registration' => '62612433', 'tax' => 'NL165102767B02', 'user_id' => 1]);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     Company::create($request->all());
     return redirect('company');
 }
Exemplo n.º 21
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CompanyRequest $request)
 {
     $company = \App\Company::create($request->all());
     flash()->success('Company ' . $company->company_name . ' successfully added!');
     return redirect('/companies');
 }
Exemplo n.º 22
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateCompanyRequest $request)
 {
     Company::create(Request::all());
     return redirect()->route('settings.company.index');
 }
Exemplo n.º 23
0
 public function store(Request $request)
 {
     $company = Company::create($request->all());
     return $company;
 }
Exemplo n.º 24
0
 /**
  * @param Requests\CreateCompanyRequest $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(CompanyRequest $request)
 {
     Company::create($request->all());
     return Redirect::to('empresas');
 }
Exemplo n.º 25
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CompanyRequest $request)
 {
     $input = $request->all();
     Company::create($input);
     return redirect('company');
 }