/** * Attempts to find a shopping cart, using the params provided * When association is set to true, once the cart is found it will be automatically linked to the authenticated user * * @param $id * @param array $relationships * @param bool $throwExceptionIfNotFound * * @param array $columns * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Support\Collection|null|static */ public function find($id, $relationships = [], $throwExceptionIfNotFound = true, $columns = array('*')) { $data = parent::find($id, $relationships, $throwExceptionIfNotFound = false, $columns); return $data; }
/** * Assign permissions to a role * * @param $roleID * @param array $permissions * * @return int */ public function givePermissions($roleID, array $permissions) { $role = parent::find($roleID); $role->attachPermissions($permissions); return 1; }