lundi 11 septembre 2017

How to save a datepicker into databse in laravel 5.4?

I want save the date into the database. But i get error saying my date is null.

public function store(Request $request)
 {

  $slot = new Slot;
  $slot->ps_name = Auth::guard('ps')->user()->name;
  $slot->date = $request->date;
  $slot->time = $request->time;
  $slot->area = $request->area;
  $slot->duration = $request->duration;


  $slot->save();
 return view('pshome');
 }

Slot database

  Schema::create('slot', function (Blueprint $table) {
        $table->increments('id');
        $table->string('ps_name');
        $table->DateTime('date');
        $table->integer('time');
        $table->integer('duration');
        $table->string('area');
        $table->timestamps();
    });



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire