public function create($name)
 {
     if (array_key_exists($name, $this->mockClasses)) {
         return $this->mockClasses[$name];
     }
     return parent::create(func_get_args());
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     Sms::create(['provider_id' => '1', 'name' => 'auth_key']);
     Sms::create(['provider_id' => '1', 'name' => 'sender_id']);
     Sms::create(['provider_id' => '1', 'name' => 'route']);
     Provider::create(array('name' => 'Msg91.com'));
     // $this->call("OthersTableSeeder");
 }
 public function run()
 {
     //se ingresa el libro de darwin
     //DB::statement("INSERT INTO lor_lecture (title, author, year, publisher, content, created_at, updated_at, deleted_at) VALUES ('El origen de las especies', 'Charles Darwin', '1859', 'Dominio publico', 'temas vivos.', NOW(),NOW(), NULL);");
     $user = User::create(array('profile' => 'super_admin', 'firstname' => 'Alexander Andres Londono Espejo', 'username' => 'admin', 'email' => '*****@*****.**', 'password' => Hash::make('admin')));
     $user->roles()->attach(1);
     $user->roles()->attach(2);
     $user->roles()->attach(3);
     $user->roles()->attach(4);
     $user->roles()->attach(5);
     $user->roles()->attach(6);
     $user->roles()->attach(7);
     $user->roles()->attach(8);
     $user->roles()->attach(9);
     $user->roles()->attach(10);
     $user->roles()->attach(11);
     $user->roles()->attach(12);
     $user->roles()->attach(13);
     $user->roles()->attach(14);
     $user->roles()->attach(15);
     $user->roles()->attach(16);
     $user->roles()->attach(17);
     $user->roles()->attach(18);
     $user->roles()->attach(19);
     $user->roles()->attach(20);
     $user->roles()->attach(21);
     $user->roles()->attach(22);
     $user->roles()->attach(23);
     $user->roles()->attach(24);
     $user->roles()->attach(25);
     $user->roles()->attach(26);
     $user->roles()->attach(27);
     $user->roles()->attach(28);
     $user->roles()->attach(29);
     $user->roles()->attach(30);
     $user->roles()->attach(31);
     $user->roles()->attach(32);
     $faker = Faker\Factory::create();
     $count_client = 50;
     foreach (range(1, $count_client) as $index) {
         $user = User::create(['firstname' => $faker->firstName, 'lastname' => $faker->lastName, 'username' => 'admin' . $index, 'email' => $faker->email, 'identification' => $faker->numberBetween(19999999, 99999999), 'password' => Hash::make('admin' . $index)]);
         //Ingreso datos de prueba de clientes
         $client = Client::create(['name' => $faker->company, 'address' => 'Caucasia Antioquia', 'enable' => 'SI']);
         //Ingreso datos de prueba de proveedores
         $provider = Provider::create(['name' => $faker->company, 'email' => $faker->email, 'telephone' => $faker->numberBetween(19999999, 99999999), 'country' => 'Colombia', 'department' => 'Antioquia', 'city' => 'Medellin', 'enable' => 'SI']);
         //Ingreso datos de prueba de costos
         $costs = Cost::create(['name' => $faker->company, 'type' => 'Otro', 'value' => $faker->numberBetween(1999, 99999), 'description' => $faker->company, 'resposible' => 'Alexander', 'enable' => 'SI']);
         //Ingreso datos de prueba de categoria
         $category = Category::create(['name' => $faker->company, 'description' => '', 'enable' => 'SI']);
         //Ingreso datos de prueba de productos
         $product = Product::create(['name' => $faker->company, 'description' => '', 'cost' => $faker->numberBetween(1999, 9999), 'value' => $faker->numberBetween(19999, 99999), 'enable' => 'SI']);
     }
 }
 /**
  * Store a newly created resource in storage.
  * POST /adminsprovider
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::only('rut', 'fancy_name', 'description', 'adress', 'city', 'location', 'phone_number');
     $this->providerRegistrationForm->validate($input);
     $provider = Provider::create($input);
     $authUser = Auth::user()->id;
     Event::fire('provider.created', [$provider, $authUser]);
     $amount = Input::only("amount");
     $products = Input::only("productos");
     //Insert products in pivot table product_provider
     Event::fire('provider.associeted', [$products, $provider, $amount]);
     return Redirect::action('AdminsProviderController@index');
 }
Example #5
0
 public function run()
 {
     Provider::create(['rut' => "78.238.140-7", 'adress' => "America 549", 'city' => "Santiago", 'location' => "San Miguel", 'phone_number' => "5544525", 'cellphone_number' => "09-93254385", 'supply_region' => "RegiĆ³n Metropolitana", 'fancy_name' => "Copol Limitada", 'description' => "Comercializado de Polietileno Copol Limitada", 'pyme' => true]);
 }