コード例 #1
0
 /**
  * Boot the application events.
  * 
  * @return void
  */
 public function boot()
 {
     $this->registerConfig();
     $this->registerTranslations();
     $this->registerViews();
     if (collect(Analytics::find(1))->contains(1)) {
         view()->share('analytics', Analytics::find(1));
     }
     if (collect(Configuracao::find(1))->contains(1)) {
         view()->share('confsite', Configuracao::find(1));
     }
     if (collect(Comentarios::where('id_status_comentario', 1)->get())->count()) {
         view()->share('comments', collect(Comentarios::where('id_status_comentario', 1)->get())->count());
     }
     view()->share('sobre', Sobres::findOrFail(1));
     if (Request::is('blog') or Request::is('blog/*')) {
         view()->share('categorias', Categoria::where('id_tipo_categoria', 3)->get());
         view()->share('ultimas', collect(Noticia::todas())->take(4));
     }
     if (Request::is('admin') or Request::is('admin/*')) {
         view()->share('ajuda', Helps::all());
     }
     view()->share('assets', Module::asset('Admin:webroot'));
 }
コード例 #2
0
ファイル: Help.php プロジェクト: safaricco/imocooer
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     try {
         Helps::destroy($id);
         session()->flash('flash_message', 'Registro apagado com sucesso');
     } catch (\Exception $e) {
         LogR::exception('destroy help', $e);
         session()->flash('flash_message', 'Ops!! Ocorreu algum problema!. ' . $e->getMessage());
     }
     return Redirect::back();
 }