Laravel Tutorial Part 5 - CRUD - Retrieving Data with Eloquent
Why Stack Overflow recommends it
Stack Overflow users link it when they are following this tutorial series and hit errors rendering variables or listing database rows, using it as a reference for the expected result.
Recommended by 1 people across 1 different months, 2013 to 2017.
What it is
A 2012 screencast from Andrew Perkins's Laravel series (Part 5) on retrieving data with Eloquent, Laravel's ORM. It covers working with a Model, creating named routes, building links with the HTML class, and adding an author page to view individual authors.
What people said
Recommends daevski · 2013-01 · Stack Overflow · on “laravel unable to render variables”
This video by andrew perkins shows it working, unless I'm missing something. Check video from 3:34 - 4:22(ish) [this video]
Cites user3537552 · 2014-09 · Stack Overflow · on “Can not view the rows of the authors table (Laravel)”
Hello and thanks for the help! I'm new to laravel and i'm trying to learn it through a tutorial that i found in youtube! [this video] Everything has been worked correctly until now! I'm trying to make a list of all the rows of my table authors My Controller authors.php <?php class Authors extends BaseController{ public function get_index(){ return View::make('authors.index') ->with('title', 'Authors Title') ->with('authors', Author::all()); } } My Model author.php <?php class Author extends Eloquent{ protected $table = 'authors'; } My View index.blade.php @extends('authors.layout') @section('content') <h2>Authors Page</h2> <h3>Welcome to the authors page</h3> <ul> @foreach($authors as $author) <l
Cites blastme · 2017-10 · Stack Overflow · on “undefined variable when trying to fetch data from database laravel”
Hi I'm having trouble getting data from database after adding a new function inside my controller. Can anyone explain to me this error and what should I do? Background information: I have 3 different type of tables, personal_infos, user_infos and user_info1s table where personal_infos hasMany user_infos and user_info1s. I am using user_id as a foreign key to link together with personal_infos table I'm using this video [this video] as a reference and want to do something like his end result (see 17.17 of video), but I get this error: Error: Undefined variable: data What I want to do: [LINK] Route.php Route::get('/home/{id}', 'HomeController@getData')->name('home'); HomeController public function g