Reading from database in Laravel 4

42 Views Asked by At

How can I get the image url stored in my database and render it on the page in laravel 4?

1

There are 1 best solutions below

1
On BEST ANSWER

Very vague question, so will be the answer. Please clarify if it's not what you need.

Assumptions: You have an Item model that is stored in a DB. In the relevant controller method you add the code below which will find the item with id 1 and will display the field named "url".

$item = Item::whereId(1)->first();
echo $item->url;