Пример #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @param EntryCrypt $entryCrypt
  * @return Response
  */
 public function destroy($id, EntryCrypt $entryCrypt)
 {
     $model = Share::findOrFail($id);
     $entry = $model->entry;
     if (!$model->delete()) {
         return Response::json(['flash' => 'Unauthorized.'], 403);
     }
     $entryCrypt->removeInvalidShares($entry);
 }
Пример #2
0
 /**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     Event::subscribe('App\\Listeners\\Events\\AuthHistoryLogger');
     Event::subscribe('App\\Listeners\\Events\\UserHistoryLogger');
     Project::observe($this->app->make('App\\Events\\Observer\\ProjectObserver'));
     Entry::observe($this->app->make('App\\Events\\Observer\\EntryObserver'));
     Share::observe($this->app->make('App\\Events\\Observer\\ShareObserver'));
     Team::observe($this->app->make('App\\Events\\Observer\\TeamObserver'));
     EntryTag::observe($this->app->make('App\\Events\\Observer\\EntryTagObserver'));
     EntryTeam::observe($this->app->make('App\\Events\\Observer\\EntryTeamObserver'));
     ProjectTeam::observe($this->app->make('App\\Events\\Observer\\ProjectTeamObserver'));
     UserTeam::observe($this->app->make('App\\Events\\Observer\\UserTeamObserver'));
 }