Locker\Repository\Base\EloquentRepository::destroy PHP Méthode

destroy() public méthode

Destroys the model with the given ID and options.
public destroy ( String $id, array $opts ) : boolean
$id String ID to match.
$opts array
Résultat boolean
    public function destroy($id, array $opts)
    {
        $model = $this->show($id, $opts);
        return $this->fire(is_null($model->delete()), 'destroy', $opts, ['id' => $id]);
    }

Usage Example

 /**
  * Destroys the model with the given ID and options.
  * @param String $id ID to match.
  * @param [String => Mixed] $opts
  * @return Boolean
  */
 public function destroy($id, array $opts)
 {
     $client = $this->show($id, $opts);
     \DB::getMongoDB()->oauth_clients->remove(['client_id' => $client->api['basic_key']]);
     if ($this->where($opts)->count() < 2) {
         $this->store(['authority' => ['name' => 'Must have client', 'mbox' => 'mailto:[email protected]']], $opts);
     }
     return parent::destroy($id, $opts);
 }
All Usage Examples Of Locker\Repository\Base\EloquentRepository::destroy