本文整理汇总了PHP中Bank::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Bank::create方法的具体用法?PHP Bank::create怎么用?PHP Bank::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
$user_id = rand(1, 10);
Bank::create(['name' => 'Bank ' . $faker->word($nb = 5), 'address' => $faker->address(), 'created_by' => $user_id, 'changed_by' => $user_id, 'change_reason' => $faker->realText(100)]);
}
}
示例2: store
/**
* Store a newly created resource in storage.
* POST /banks
*
* @return Response
*/
public function store()
{
$validator = Validator::make($data = Input::all(), Bank::$rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$data['created_by'] = Auth::user()->id;
$data['changed_by'] = Auth::user()->id;
Bank::create($data);
return Redirect::route('admin.banks.index');
}
示例3: bank_create_form_submit
function bank_create_form_submit($data)
{
$data['church_id'] = $_SESSION['log_church_id'];
$data['date_created'] = date("Y-m-d");
$data['date_lastchange'] = date("Y-m-d");
$error = bank_validate($data);
if (!empty($error)) {
return FALSE;
}
$bank = new Bank();
$response = $bank->create($data);
if ($response['id'] > 0) {
return bank_list($response['id']);
} else {
return false;
}
}
示例4: run
public function run()
{
Bank::create(['name' => "Santander", 'company_id' => '1']);
}