My goal is set value if field is empty.
But get "Trying to get property of non-object" error.
last_day is empty field, how to assign value 1 ?
public function getPointsForExercises(){
$ls = Auth::user()->lessons()->get();
$last_day = Auth::user()->user_settings->last_day;
if (empty($user->user_settings->last_lesson)) {
$user->user_settings->last_lesson = 1;
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire