示例#1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create('es_ES');
     $sector = App\Sector::all()->lists('id')->toArray();
     for ($i = 0; $i < 30; $i++) {
         DB::table('clientes')->insert(['rut' => $faker->numerify('##.###.###-#'), 'nombres' => $faker->firstName, 'apellido_paterno' => $faker->lastName, 'apellido_materno' => $faker->lastName, 'direccion' => $faker->address, 'email' => $faker->companyEmail, 'telefono' => $faker->phoneNumber, 'sector_id' => $faker->randomElement($sector), 'fecha_ingreso' => $faker->date(), 'created_at' => 'now', 'updated_at' => 'now']);
     }
 }
示例#2
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', ['middleware' => 'auth', function () {
    $user = App\User::count();
    $inventario = App\Inventario::count();
    $centro = App\CentroCosto::count();
    $sector = App\Sector::count();
    return view('main')->with("sector", $sector)->with("centro", $centro)->with("inventario", $inventario)->with("user", $user);
}]);
Route::controller('productos', 'ProductoController');
Route::controller('inventario', 'InventarioController');
Route::controller('bien-activo', 'BienActivoController');
Route::controller('bien-registro', 'BienRegistroController');
Route::controller('bien-licencia', 'BienLicenciaController');
Route::controller('bien-raiz', 'BienRaizController');
Route::controller('usuarios', 'UsuariosController');
Route::controller('categorias', 'CategoriasController');
Route::controller('centrocosto', 'CentroCostoController');
Route::controller('sector', 'SectorController');
Route::controller('login', 'LoginController');