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


PHP Branch::create方法代碼示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|max:255', 'mobile' => 'numeric|min:10', 'telephone' => 'numeric']);
     $input = $request->all();
     $input['company_id'] = Auth::user()->company->id;
     $input['account_year_id'] = session('account');
     Branch::create($input);
     flash()->success('Branch Created Successfully !');
     return redirect('branch');
 }
開發者ID:sahilbhatt92,項目名稱:transpt,代碼行數:15,代碼來源:BranchController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $validator = Validator::make([$request->all(), 'nom_branche' => $request->nom_branche, 'code_branche' => $request->code_branche], ['nom_branche' => 'required', 'code_branche' => 'required'], ['nom_branche.required' => "le nom de la branche est requis", 'code_branche.required' => "le Code de la branche est requis"]);
     if ($validator->passes()) {
         Branch::create(['nom_branche' => $request->nom_branche, 'code_branche' => $request->code_branche, 'user_id' => \Auth::user()->id]);
         return redirect()->action('StatisticsController@gestion')->with('success', 'Informations bien enregistrées');
     } else {
         return redirect()->back()->withErrors($validator);
     }
 }
開發者ID:khaleader,項目名稱:creche,代碼行數:16,代碼來源:BranchesController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     if (Auth::user()->role === 'superadmin' && Auth::user()->email === 'nlnazmul@gmail.com') {
         $input = $request->all();
         Branch::create($input);
         return redirect('branch');
     } else {
         return redirect('auth/login');
     }
 }
開發者ID:nazmule27,項目名稱:pos,代碼行數:16,代碼來源:BranchController.php

示例4: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     \App\Branch::create(['name' => 'denpasar', 'city' => 'denpasar', 'province' => 'bali', 'country' => 'indonesia']);
     \App\Branch::create(['name' => 'surabaya', 'city' => 'surabaya', 'province' => 'jawatimur', 'country' => 'indonesia']);
 }
開發者ID:candrasetiadi,項目名稱:nvjvnjsdnnvdvdw,代碼行數:11,代碼來源:BranchesTableSeeder.php


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