本文整理汇总了PHP中Cliente::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Cliente::create方法的具体用法?PHP Cliente::create怎么用?PHP Cliente::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cliente
的用法示例。
在下文中一共展示了Cliente::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
// $this->call('UserTableSeeder');
MaterialCategoria::create(array('nombre' => 'Sin Categoria', 'tipo' => 'unidad'));
ModuloCategoria::create(array('nombre' => 'Sin Categoria'));
Cliente::create(array('nombre' => 'Anonimo', 'apellido' => 'equis', 'persona' => 'n', 'identificacion' => '00000', 'telefono' => '00000', 'email' => 'anonimo@xxx.com', 'celular' => '00000', 'sexo' => 'm', 'nacimiento' => '00-00-00'));
User::create(array('username' => 'master', 'email' => 'master@xxx.com', 'password' => Hash::make('123456'), 'role' => 'master'));
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
// Validator
// leia mais sobre Validator em http://laravel.com/docs/validation
$rules = array();
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to('clientes/create')->withErrors($validator)->withInput(Input::except('password'));
} else {
// store
Cliente::create($this->post_to_array($this->table_fields));
//Session::flush();
$alert[] = ['class' => 'alert-success', 'message' => 'Novo cliente adicionado!'];
Session::flash('alerts', $alert);
return Redirect::to('clientes');
}
}
示例3: run
public function run()
{
$faker = Faker::create('pt_BR');
$faker->addProvider(new \Faker\Provider\pt_BR\Person($faker));
// $faker->addProvider(new \Faker\Provider\en_US\Address($faker));
// $faker->addProvider(new \Faker\Provider\en_US\PhoneNumber($faker));
// $faker->addProvider(new \Faker\Provider\en_US\Company($faker));
// $faker->addProvider(new \Faker\Provider\Lorem($faker));
// $faker->addProvider(new \Faker\Provider\Internet($faker));
foreach (range(1, 50) as $index) {
// title($gender = null|'male'|'female') // 'Ms.'
// titleMale // 'Mr.'
// titleFemale // 'Ms.'
// suffix // 'Jr.'
// name($gender = null|'male'|'female') // 'Dr. Zane Stroman'
// firstName($gender = null|'male'|'female') // 'Maynard'
// firstNameMale // 'Maynard'
// firstNameFemale // 'Rachel'
// lastName // 'Zulauf'
Cliente::create(['nome' => $faker->name(), 'telefone' => $faker->phoneNumber(), 'empresa' => $faker->company(), 'endereco' => $faker->streetAddress(), 'bairro' => $faker->secondaryAddress(), 'cidade' => $faker->city(), 'cep' => $faker->postcode(), 'uf' => $faker->state(), 'celular' => $faker->phoneNumber(), 'email' => $faker->email(), 'cnpj' => $faker->numerify('###.###.###-##'), 'ie' => $faker->numerify('###.###.###.###')]);
}
}
示例4: run
public function run()
{
DB::table('Clientes')->delete();
Cliente::create(array('nombre' => 'Aldo', 'apellido' => 'Alonso', 'correo' => 'aldoalonso@gmail.com', 'nombreUsuario' => 'aldo10'));
}
示例5: run
public function run()
{
foreach (range(1, 6) as $index) {
Cliente::create(['id_estado' => 2, 'id_alumno' => $index]);
}
}