j42 / laravel-firebase

A Firebase port for Laravel (4.2+)
MIT License
51 stars 22 forks source link

Eloquent model for firebase #23

Open javiervelaz opened 8 years ago

javiervelaz commented 8 years ago

Could you give some example? how modeling a firebase collecion inside the model file?

I did this in model/comment.php

class comment extends Eloquent{ protected $table = 'comment'; protected $primaryKey = 'id'; protected $connection = 'firebase'; }

database.php 'firebase' => array( 'host' => 'https://mydb.firebaseio.com/', 'token' => 'kadksakdlaskdsioiei203222kl2k3223', 'timeout' => 10, 'sync' => true, // OPTIONAL: auto-sync all Eloquent models with Firebase? )