Laravel Databases

Easy data management.


  • Multiple connections
  • Eloquent ORM
  • Migrations and seeding tools

Connection Options



  • MySQL
  • Postgres
  • SQLite
  • SQL Server

Database GUI

View data quickly and easily.


  • All: Navicat
  • Mac: Sequel Pro
  • Windows: HeidiSQL
  • Linux: SQuirreL SQL

Eloquent ORM

  • Object relational mapping
  • Built on PHP ActiveRecord

Database Table <-> "Model"

User Model


$query = "SELECT * FROM users where id = '1'";
$result = mysql_query($query);
$user = User::find(1);


Inserting data into our database.

Model Factory: Easy way to generate fake data

Blade Templating

  • layouts
  • pages
  • partials

Extending Layouts


Extending Layouts

    the content goes here

Including Child Views


Echo Comparison

// normal php data
<?php echo $username ?>
// with blade tags
{{ $username }}


    <script src="js/dashboard.js"></script>

Laravel Databases

By Chris Sevilleja

Laravel Databases

  • 514
Loading comments...

More from Chris Sevilleja