Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|max:255', 'contact' => 'numeric|min:10', 'g_photo' => 'image|max:1024', 'photo' => 'image|max:1024', 'license_photo' => 'image|max:1024']);
     $input = $this->getAll($request, 'store', '');
     Driver::create($input);
     flash()->success('Driver Created Successfully !');
     return redirect('driver');
 }
Ejemplo n.º 2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $limit = 40;
     for ($i = 0; $i < $limit; $i++) {
         Driver::create(['email' => $faker->unique()->email, 'name' => $faker->firstName, 'phone' => $faker->phoneNumber, 'license_no' => rand(100000, 999999), 'pco_license_no' => rand(100000, 999999), 'dob' => $faker->date('d-m-Y')]);
     }
 }
Ejemplo n.º 3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //$this->validate($request, $this->rules);
     $input = Input::all();
     $input['user_id'] = Auth::User()->id;
     Driver::create($input);
     Session::flash('flash_message', 'Driver created successfully!');
     return Redirect::route('driver.index')->with('Driver created.');
 }
Ejemplo n.º 4
0
 public function store(RegisterDriverRequest $request)
 {
     Driver::create($request->all());
     return redirect(url('admin/driver/all'));
 }
Ejemplo n.º 5
0
 public function create(Request $request)
 {
     Driver::create(['fio' => $request->fio, 'birthday' => date('d.m.Y', strtotime($request->birthday)), 'passport_number' => $request->passport_number, 'drivers_license_number' => $request->drivers_license_number, 'drivers_license_date' => date('d.m.Y', strtotime($request->drivers_license_date)), 'user_id' => Auth::user()->id]);
     return redirect('drivers');
 }
Ejemplo n.º 6
0
 public function storeDriver(Request $request)
 {
     $driver = Driver::create($request->all());
     $driver->save();
     return redirect('investor/drivers');
 }