On November 10, 2020 . By CodimTh Category: Web Laravel Laravel - Trying to get property 'id' of non-object The error is because $this->client is null when find() cannot find the record. You need to be sure if the record exists or not. Change: $this->client = Client::find(1); To: $this->client = Client::findOrFail(1); Tags : Laravel Laravel tutoriel Tips Laravel Previous PostLaravel - Cannot truncate a table referenced in a foreign key constraintNext PostChange default primary key in Eloquent in Laravel Comments Add new comment Your name Subject Comment About text formats Restricted HTML Leave this field blank
Comments