Commit e93b2625 authored by unknown's avatar unknown

test models added

parent aed212a7
<?php
use Jenssegers\Mongodb\Model as Eloquent;
class Client extends Eloquent {
protected $collection = 'clients';
protected static $unguarded = true;
public function users()
{
return $this->belongsToMany('User');
}
}
\ No newline at end of file
......@@ -7,13 +7,11 @@ use Illuminate\Auth\Reminders\RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
protected $collection = 'users';
protected $collection = 'users';
protected $dates = array('birthday');
protected static $unguarded = true;
protected static $unguarded = true;
public function books()
public function books()
{
return $this->hasMany('Book', 'author_id');
}
......@@ -27,6 +25,11 @@ class User extends Eloquent implements UserInterface, RemindableInterface {
{
return $this->hasOne('Role');
}
public function clients()
{
return $this->belongsToMany('Client');
}
/**
* Get the unique identifier for the user.
......@@ -58,4 +61,4 @@ class User extends Eloquent implements UserInterface, RemindableInterface {
return $this->email;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment