<?php require_once 'vendor/autoload.php'; Pushpad\Pushpad::$auth_token = '3f31ce907b0008fbde64d2f21399b9c7'; Pushpad\Pushpad::$project_id = 1211; ?> <div class="navbar-fixed"> <header id="header" class=""> <nav> <div class="nav-wrapper "> <a href="{{ url('/') }}" class="brand-logo center"><img id="brand-logo" src="{{asset('images/logo-completo.png')}}" width="120"></a> <a href="#" data-activates="mobile-demo" class="button-collapse"><i class="fa fa-bars"></i></a> <ul class="right hide-on-med-and-down"> @if(Auth::check()) <li class="tooltipped dropdown-button" data-activates="dropdown2" data-delay="10" data-constrainwidth="false" data-beloworigin="true" data-alignment="right" data-tooltip="Notificaciones"> <a href="#!"><i style="font-size:18px" class="fa fa-bell badge1" data-badge="{{sizeof($notificaciones)}}"> </i> </a> </li> <li> <a class="dropdown-button valign-wrapper" href="#!" data-beloworigin="true" data-hover="true" data-activates="dropdown1" data-alignment="left"> @if (Auth::check() && Auth::user()->avatar != null) <img class="left avatar circle valign" src="{{Auth::user()->avatar}}" alt=""> @endif {{str_limit(Auth::user()->nombre,20,"...")}} <i class="right fa fa-caret-down"></i> </a> </li> @endif </ul> <ul class="center hide-on-med-and-down"> @if (!Auth::check())
public function push() { Notificacion::InsertarNotificacionesMasivas(Input::get('titulo'), Input::get('mensaje')); //Notificaciones en android $dispositivos = Dispositivo::active()->mensajes()->get(); $disp = []; foreach ($dispositivos as $dispositivo) { $disp[] = PushNotification::Device($dispositivo->token); } $devices = PushNotification::DeviceCollection($disp); $message = PushNotification::Message(Input::get('mensaje'), ['badge' => 1, 'image' => 'www/logo.png', 'soundname' => 'alert', "ledColor" => [0, 146, 234, 255], 'title' => Input::get('titulo'), "style" => "inbox", "summaryText" => "Tienes %n% notificaciones", 'actions' => [["title" => "Abrir", "callback" => "abrir", "foreground" => false]]]); $collection = PushNotification::app('android')->to($devices)->send($message); // notificaciones en el navegador require_once 'vendor/autoload.php'; Pushpad\Pushpad::$auth_token = '3f31ce907b0008fbde64d2f21399b9c7'; Pushpad\Pushpad::$project_id = 1211; $notification = new Pushpad\Notification(array('body' => Input::get('mensaje', ''), 'title' => Input::get('titulo', 'Residencias Online'))); $notification->broadcast(['tags' => []]); Session::flash('success', 'Mensaje enviado'); return Redirect::back(); }