Support the ongoing development of Laravel.io →
Database Views Blade
Last updated 4 months 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 4 months ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.