(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| @extends('main') | |
| @section('header') | |
| <h2>About this site</h2> | |
| @stop | |
| @section('content') | |
| <p>There are over {{$number_of_cats}} cats on this site</p> | |
| @stop |
| <!-- Latest compiled and minified CSS --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous"> | |
| <!-- Optional theme --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous"> | |
| <!-- Latest compiled and minified JavaScript --> | |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script> |
| <?php | |
| class BreedsTableSeeder extends Seeder { | |
| public function run(){ | |
| DB::table('breeds')->insert(array( | |
| array('id'=>1, 'name'=>"Domestic"), | |
| array('id'=>2, 'name'=>"Persian"), | |
| array('id'=>3, 'name'=>"Siamese"), | |
| array('id'=>4, 'name'=>"Abyssinian"), | |
| )); | |
| } |
| <?php | |
| Schema::create('cats', function($table){ | |
| $table->increments('id'); | |
| $table->string('name'); | |
| $table->date('date_of_birth'); | |
| $table->integer('breed_id')->nullable(); | |
| $table->timestamps(); | |
| }); | |
| Schema::create('breeds', function($table){ | |
| $table->increments('id'); |
| <?php | |
| public class Breed extends Eloquent{ | |
| public $timestamp = false; | |
| public function cats(){ | |
| return $this->hasMany('Cat'); | |
| } | |
| } |
| <?php | |
| class Cat extends Eloquent { | |
| protected $fillable = array('name','date_of_birth','breed_id'); | |
| public function breed(){ | |
| return $this->belongsTo('Breed'); | |
| } | |
| } |
| <?php | |
| /** | |
| * A helper file for Laravel 5, to provide autocomplete information to your IDE | |
| * Generated for Laravel 5.1.1 (LTS) on 2015-06-11. | |
| * | |
| * @author Barry vd. Heuvel <[email protected]> | |
| * @see https://github.com/barryvdh/laravel-ide-helper | |
| */ | |
| namespace { |