當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。