your raw query returns an array of objects. a quick ugly way would be to use $books[0]->title;
better use eloquent's
$book = Book::where('slug', $slug)->first();
zam3858 said:
your raw query returns an array of objects. a quick ugly way would be to use $books[0]->title;
better use eloquent's
$book = Book::where('slug', $slug)->first();
Yap! The problem is solved, thanks!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community