I have a password_resets
table in mysql database and i want to get single raw of data and delete it with one query in Lumen with DB
facade like this:
$reset_row = DB::table('password_resets')->where('token', $request->token)->first()->delete();
But i have a error :
Call to undefined method stdClass::delete()
i try this code :
$reset_row = DB::table('password_resets')->where('token', $request->token)
//do my work whith $reset_row->first();
$reset_row->delete();
But i think this way use 2 query to do this work.
NOTE : i know i can not delete and reason is first()
method )return it to array)
Is there any way to do this?