Skip to content

Instantly share code, notes, and snippets.

@ricardo-rossi ricardo-rossi/Nutrient.php

Last active Aug 29, 2015
Embed
What would you like to do?
<?php
class Nutrient extends BaseModel {
protected $guarded = array();
public static $rules = array(
'name' => 'required',
'unit' => 'required'
);
public static function with($relations)
{
$b = parent::with($relations);
return parent::filterByAccount($b);
}
public function save(array $options = array())
{
parent::setAccount();
parent::save($options);
}
public static function all($columns = array('*'))
{
return parent::filterByAccount()->get();
}
public static function find($id, $columns = array('*'))
{
$b = parent::where('id', $id);
return parent::filterByAccount($b)->first();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.