Skip to content
Permalink
Browse files

Merge pull request #42 from alextime/master

Move closure routes to controller methods to allow caching routes
  • Loading branch information...
akazorg committed Feb 14, 2019
2 parents d6d3905 + 88aaa6e commit ca6f1e8afd4ee218782240875369cdd02c4c73ca
Showing with 39 additions and 6 deletions.
  1. +2 −6 routes/web.php
  2. +10 −0 src/Http/Controllers/MessagesController.php
  3. +27 −0 src/Http/Controllers/PagesController.php
@@ -20,9 +20,7 @@
], function () {
// Mercurius home
Route::get('/messages', function () {
return View('mercurius::mercurius');
})->name('home');
Route::get('/messages', ['as' => 'home', 'uses' => 'MessagesController@index']);
// User Profile
Route::get('/profile/refresh', 'ProfileController@refresh');
@@ -42,7 +40,5 @@
Route::post('/receivers', 'ReceiversController@search');
// Dummy page example
Route::get('/notification-page-sample', function () {
return View('mercurius::example');
})->name('example');
Route::get('/notification-page-sample', ['as' => 'example', 'uses' => 'PagesController@notificationPageSample']);
});
@@ -19,6 +19,16 @@ public function __construct()
$this->middleware('auth');
}
/**
* Index all messages
*
* @return mixed
*/
public function index()
{
return View('mercurius::mercurius');
}
/**
* Send a message from the current user.
*
@@ -0,0 +1,27 @@
<?php
namespace Launcher\Mercurius\Http\Controllers;
class PagesController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Index all messages
*
* @return mixed
*/
public function notificationPageSample()
{
return View('mercurius::example');
}
}

0 comments on commit ca6f1e8

Please sign in to comment.
You can’t perform that action at this time.