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


PHP Branch::create方法代码示例

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


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

示例1: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Branch::create(['name' => $faker->city, 'address' => $faker->address]);
     }
 }
开发者ID:bryanestrito,项目名称:datawarehouse_etl,代码行数:7,代码来源:BranchesTableSeeder.php

示例2: store

 /**
  * Store a newly created branch in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Branch::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     Branch::create($data);
     return Redirect::route('branches.index');
 }
开发者ID:bryanestrito,项目名称:datawarehouse_etl,代码行数:14,代码来源:BranchesController.php

示例3: createBranch

 public function createBranch()
 {
     $branch = Branch::create(array('strBrchID' => Input::get('brnchID'), 'strBrchName' => Input::get('brnchName'), 'strBrchAddress' => Input::get('brnchAdd')));
     $branch->save();
     return Redirect::to('/branches');
 }
开发者ID:ExperimentalGroup,项目名称:inventory,代码行数:6,代码来源:HomeController.php

示例4: Create

 public static function Create($branch)
 {
     return Branch::create(array('name' => $branch->name, 'address' => $branch->address, 'telephone' => $branch->telephone));
 }
开发者ID:krasaler,项目名称:FamilyStore,代码行数:4,代码来源:BranchService.php

示例5: postNewCampus2

 public function postNewCampus2()
 {
     //verify the user input and create account
     $validator = Validator::make(Input::all(), array('College' => 'required|exists:institutions,id', 'Campus' => 'required|max:200'));
     if ($validator->fails()) {
         return Redirect::route('newcampus-get')->withErrors($validator)->withInput()->with('global', 'Sorry!! College details were not posted, please retry.');
     } else {
         $collegeid = Input::get('College');
         $campus = Input::get('Campus');
         //save college to the database
         //store the user details
         $branch = Branch::create(array('user_id' => Auth::user()->id, 'institutions_id' => $collegeid, 'name' => $campus));
         if ($branch) {
             //load success page
             if (Auth::user()) {
                 return Redirect::route('member-home')->with('global', 'Congratulations!! Your College has been added successfully.<br/><a href="http://www.squeeber.com/newcampus" >Add another</a>');
             } else {
                 return Redirect::route('home')->with('global', 'Congratulations!! Your College has been added successfully.<br/><a href="http://www.squeeber.com/newcampus" >Add another</a>');
             }
         }
         return Redirect::route('newcampus-get')->withInput()->with('global', 'Sorry!! Campus details were not posted, please retry.');
     }
 }
开发者ID:franqq,项目名称:squeeber,代码行数:23,代码来源:CollegeController.php


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