/**
  * Execute the job.
  *
  * @return void
  */
 public function handle(ContactRepository $repository)
 {
     $contact = $repository->get($this->id);
     $repository->remove($contact);
     // Trigger Event to Update All the Clients
     pusher()->trigger('contacts', 'remove', json_encode($contact));
 }
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(ContactRepository $repository)
 {
     // Create Contact in the Datastore
     $contact = $repository->createOrUpdate(['firstname' => $this->firstname, 'lastname' => $this->lastname, 'email' => $this->email, 'website' => $this->website, 'phone' => $this->phone]);
     // Trigger Event to Update All the Clients
     pusher()->trigger('contacts', 'create', json_encode($contact));
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $this->resultado->fill($request->all());
     $this->resultado->save();
     pusher()->trigger('resultados_canal', 'ResultadoActualizado', ['data' => true]);
     return response()->json(['mensaje' => 'Actualizado con Exito']);
 }
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'module_aggregator');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
     pusher('sidebar', 'module_aggregator::sidebar', [], 0);
     require __DIR__ . '/routes.php';
 }
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'backend_dashboard');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
     pusher('sidebar', 'backend_dashboard::sidebar', [], 100);
     require __DIR__ . '/routes.php';
 }
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'themes');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'themes');
     pusher('sidebar', 'themes::sidebar', [], 95);
     require __DIR__ . '/routes.php';
 }
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'pages');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
     $this->publishes([__DIR__ . '/../migrations/' => database_path('migrations')], 'migrations');
     pusher('sidebar', 'pages::sidebar', [], 99);
     require __DIR__ . '/routes.php';
 }
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'content_types');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
     $this->publishes([__DIR__ . '/../migrations/' => database_path('migrations')], 'migrations');
     pusher('sidebar', 'content_types::sidebar', [], 1);
     pusher('sidebar', 'content_types::posts_menu', ['types' => ContentType::all()], 98);
     require __DIR__ . '/routes.php';
 }
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'blocks');
     $this->loadViewsFrom(blocks_path(), 'block');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
     $this->publishes([__DIR__ . '/../public' => public_path('code_mirror')], 'public');
     pusher('sidebar', 'blocks::sidebar', [], 2);
     pusher('widgets', 'blocks::block_widget', ['blocks' => \Block::all()]);
     require __DIR__ . '/routes.php';
     require __DIR__ . '/blade.php';
 }
 public function store(Request $request)
 {
     switch ($request['tipo_comentario_id']) {
         case 4:
             Gol::create(['equipo_id' => $request['equipo_id'], 'minuto' => $request['minuto'], 'partido_id' => $request['partido_id']]);
             break;
     }
     Comentario::create($request->all());
     $last = Comentario::all()->last();
     pusher()->trigger('comentarios_canal', 'ComentarioCreado', ['data' => true, 'comentario' => $last]);
     return response()->json(["mensaje" => "Comentario Creado con Exito"]);
 }
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->app[Kernel::class]->pushMiddleware(Middleware::class);
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'backend_auth');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
     $this->publishes([__DIR__ . '/../config/config.php' => config_path('module.php')], 'config');
     $this->publishes([__DIR__ . '/../config/auth.php' => config_path('auth.php')], 'config');
     $this->publishes([__DIR__ . '/../public' => public_path('backend_auth')], 'public');
     $this->publishes([__DIR__ . '/../migrations/' => database_path('migrations')], 'migrations');
     require __DIR__ . '/routes.php';
     pusher('user_menu', 'backend_auth::user_menu');
     pusher('sidebar', 'backend_auth::sidebar', [], 2);
     pusher('widgets', 'backend_auth::user_widget', ['users' => User::all()]);
 }
function trigPostFollowers($postId, $userId, $action_type = '')
{
    $res = conn()->query("SELECT follower_id FROM following\n    WHERE post_id='{$postId}' AND follower_id!='{$userId}'");
    $followers = convertToArray($res);
    $user = getUsername($userId);
    if ($action_type) {
        $data['action'] = $action_type;
        $data['user_id'] = $userId;
        $data['post_id'] = $postId;
        $data['username'] = $user['username'];
        $data['full_name'] = $user['full_name'];
        $data['profile_pic'] = $user['profile_pic'];
        $query = conn()->prepare("DELETE FROM notifications\n        WHERE post_id=? AND user_id=? AND action_type=?");
        $query->bind_param('iii', $postId, $userId, $action_type);
        $query->execute();
        $query->close();
        foreach ($followers as $ind => $follower) {
            $query = conn()->prepare("INSERT INTO notifications (follower_id, post_id, user_id, action_type) VALUES (?, ?, ?, ?)");
            $query->bind_param('iiis', $follower['follower_id'], $postId, $userId, $action_type);
            $query->execute();
            $query_errors = count($query->error_list);
            $query->close();
            pusher()->trigger((string) $follower['follower_id'], 'new_notification', $data);
        }
    }
}
Exemple #13
0
Route::get('partidos/setMarcador/{id}', 'PartidosController@setMarcador');
Route::get('muestraLocal/{partido}', 'ResultadosController@muestraLocal');
Route::get('muestraVisitante/{partido}', 'ResultadosController@muestraVisitante');
Route::get('muestraEquipoHincha/{equipoId}', 'HinchasController@showEquipo');
Route::resource('noticias', 'NoticiasController');
Route::resource('arbitros', 'ArbitrosController');
Route::resource('tecnicos', 'TecnicosController');
Route::resource('comentarios', 'ComentariosController');
Route::get('comentariosPartido/{partido}', 'ComentariosController@comentariosPartido');
Route::post('comentarios/store', 'ComentariosController@store');
Route::get('calendarios', 'HinchasController@calendarios');
Route::get('getNoticias', 'HinchasController@noticias');
Route::get('getCategoriaNoticias', 'HinchasController@categoriaNoticias');
Route::put('finalizarPartido', 'PartidosController@finalizar');
Route::get('tablas', 'HinchasController@posiciones');
Route::get('/bridge', function () {
    pusher()->trigger('comentarios_canal', 'evento', ['data' => true, 'text' => 'aqui estoy probando']);
    return view('welcome');
});
Route::get('comentarios/show/{id}', 'ComentariosController@show');
Route::get('hinchas/show/{correo}', 'HinchasController@show');
Route::get('pruebaSocket/', 'PartidosController@pruebaSocket');
Route::group(array('middleware' => ''), function () {
    Route::controller('filemanager', 'FilemanagerLaravelController');
});
Route::group(['prefix' => 'api'], function () {
    Route::resource('authenticate', 'AuthenticateController', ['only' => ['index']]);
    Route::post('authenticate', 'AuthenticateController@authenticate');
});
Route::get('authenticate/show/{id}', 'AuthenticateController@show');
Route::delete('/tecnicos/borrar/{id}', 'TecnicosController@borrar');
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     pusher('test', 'test');
 }