vendredi 29 septembre 2017

Using And where condition in Laravel model

What am trying to do is to use andWhere in my request

$passwordreset =  PasswordResets::where('token', $request->resetcode)
   ->andWhere('created_at','>',Carbon::now()->subHours(2))//error due to and
   ->first();

But the above returns an error.How can i perform this using the Model not DB:table since i would like a standard way of writing my code just by using the model.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire