Support the ongoing development of Laravel.io →
Database Views Blade
Last updated 2 years ago.
0

Hi.

First: read about Eleoquent ORM, how to get data from database. http://laravel.com/docs/4.2/eloquent

Second: Learn here how to pass data to views. http://laravel.com/docs/4.2/responses#views

Resume / Example:

Route::get('/', function()
{
    $data = Model::all(); // where "Model" can be any model you have inside of models directory or declared (eg. User).
    return View::make('index')->with('data', $data);  // now you can use the variable $data inside of your view.
});

Best luck.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.