当前位置: 首页>>代码示例>>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;未经允许,请勿转载。