Beispiel #1
0
<?php

use App\Events\UserHasRegistered;
use App\Alert;
// Landing Page for pre-release
Route::get('/', ['as' => 'landing.optin', 'uses' => 'LandingController@create']);
Route::post('/', ['as' => 'landing.confirm', 'uses' => 'LandingController@store']);
Route::get('/home', function () {
    return view('home');
});
Route::resource('alerts', 'AlertController', ['names' => ['create' => 'alerts.new']]);
Route::get('admin', ['as' => 'admin', 'middleware' => 'auth', function () {
    $alerts = Alert::all();
    return view('alerts.index')->with('alerts', $alerts);
    // return "Admin Panel";
}]);
// Alert endpoint to ping for sending
Route::get(env('ALERT_SEND_ENDPOINT'), function () {
    $handler = new App\AlertHandler(new App\Curl());
    $handler->sendAlertEmails(env('ALERT_FETCH_RANGE'));
});
// Authentication routes...
Route::get('auth/login', 'Auth\\AuthController@getLogin');
Route::post('auth/login', 'Auth\\AuthController@postLogin');
Route::get('auth/logout', 'Auth\\AuthController@getLogout');
// Social Authentication...
Route::get('auth/facebook', 'Auth\\AuthController@redirectToProvider');
Route::get('auth/facebook/callback', 'Auth\\AuthController@handleProviderCallback');
// Registration routes...
Route::get('auth/register', 'Auth\\AuthController@getRegister');
Route::post('auth/register', 'Auth\\AuthController@postRegister');
Beispiel #2
0
 public function index()
 {
     return Alert::all();
 }