Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 74e0f388
authored
Apr 07, 2019
by
Linus Juhlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the single-purpose controllers into invokable controllers instead.
1 parent
2b070690
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
app/Http/Controllers/DashboardController.php
app/Http/Controllers/ReportsController.php
routes/web.php
app/Http/Controllers/DashboardController.php
View file @
74e0f38
...
...
@@ -6,7 +6,7 @@ use Inertia\Inertia;
class
DashboardController
extends
Controller
{
public
function
index
()
public
function
__invoke
()
{
return
Inertia
::
render
(
'Dashboard/Index'
);
}
...
...
app/Http/Controllers/ReportsController.php
View file @
74e0f38
...
...
@@ -6,7 +6,7 @@ use Inertia\Inertia;
class
ReportsController
extends
Controller
{
public
function
index
()
public
function
__invoke
()
{
return
Inertia
::
render
(
'Reports/Index'
);
}
...
...
routes/web.php
View file @
74e0f38
...
...
@@ -17,7 +17,7 @@ Route::post('login')->name('login.attempt')->uses('Auth\LoginController@login');
Route
::
get
(
'logout'
)
->
name
(
'logout'
)
->
uses
(
'Auth\LoginController@logout'
);
// Dashboard
Route
::
get
(
'/'
)
->
name
(
'dashboard'
)
->
uses
(
'DashboardController
@index
'
)
->
middleware
(
'auth'
);
Route
::
get
(
'/'
)
->
name
(
'dashboard'
)
->
uses
(
'DashboardController'
)
->
middleware
(
'auth'
);
// Accounts
Route
::
get
(
'accounts'
)
->
name
(
'accounts'
)
->
uses
(
'AccountsController@index'
)
->
middleware
(
'remember'
,
'auth'
);
...
...
@@ -56,7 +56,7 @@ Route::delete('contacts/{contact}')->name('contacts.destroy')->uses('ContactsCon
Route
::
put
(
'contacts/{contact}/restore'
)
->
name
(
'contacts.restore'
)
->
uses
(
'ContactsController@restore'
)
->
middleware
(
'auth'
);
// Reports
Route
::
get
(
'reports'
)
->
name
(
'reports'
)
->
uses
(
'ReportsController
@index
'
)
->
middleware
(
'auth'
);
Route
::
get
(
'reports'
)
->
name
(
'reports'
)
->
uses
(
'ReportsController'
)
->
middleware
(
'auth'
);
// 500 error
Route
::
get
(
'500'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment