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 64a51049
authored
Dec 18, 2019
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify redirects
1 parent
0ede36c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
app/Http/Controllers/ContactsController.php
app/Http/Controllers/OrganizationsController.php
app/Http/Controllers/UsersController.php
app/Http/Controllers/ContactsController.php
View file @
64a5104
...
...
@@ -111,20 +111,20 @@ class ContactsController extends Controller
])
);
return
Redirect
::
route
(
'contacts.edit'
,
$contact
)
->
with
(
'success'
,
'Contact updated.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'Contact updated.'
);
}
public
function
destroy
(
Contact
$contact
)
{
$contact
->
delete
();
return
Redirect
::
route
(
'contacts.edit'
,
$contact
)
->
with
(
'success'
,
'Contact deleted.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'Contact deleted.'
);
}
public
function
restore
(
Contact
$contact
)
{
$contact
->
restore
();
return
Redirect
::
route
(
'contacts.edit'
,
$contact
)
->
with
(
'success'
,
'Contact restored.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'Contact restored.'
);
}
}
app/Http/Controllers/OrganizationsController.php
View file @
64a5104
...
...
@@ -79,20 +79,20 @@ class OrganizationsController extends Controller
])
);
return
Redirect
::
route
(
'organizations.edit'
,
$organization
)
->
with
(
'success'
,
'Organization updated.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'Organization updated.'
);
}
public
function
destroy
(
Organization
$organization
)
{
$organization
->
delete
();
return
Redirect
::
route
(
'organizations.edit'
,
$organization
)
->
with
(
'success'
,
'Organization deleted.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'Organization deleted.'
);
}
public
function
restore
(
Organization
$organization
)
{
$organization
->
restore
();
return
Redirect
::
route
(
'organizations.edit'
,
$organization
)
->
with
(
'success'
,
'Organization restored.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'Organization restored.'
);
}
}
app/Http/Controllers/UsersController.php
View file @
64a5104
...
...
@@ -79,8 +79,8 @@ class UsersController extends Controller
public
function
update
(
User
$user
)
{
return
Redirect
::
route
(
'users.edit'
,
$user
)
->
with
(
'error'
,
'Updating the demo user is not allowed.'
);
if
(
App
::
environment
(
'demo'
)
&&
$user
->
isDemoUser
())
{
return
Redirect
::
back
()
->
with
(
'error'
,
'Updating the demo user is not allowed.'
);
}
Request
::
validate
([
...
...
@@ -102,24 +102,24 @@ class UsersController extends Controller
$user
->
update
([
'password'
=>
Request
::
get
(
'password'
)]);
}
return
Redirect
::
route
(
'users.edit'
,
$user
)
->
with
(
'success'
,
'User updated.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'User updated.'
);
}
public
function
destroy
(
User
$user
)
{
return
Redirect
::
route
(
'users.edit'
,
$user
)
->
with
(
'error'
,
'Deleting the demo user is not allowed.'
);
if
(
App
::
environment
(
'demo'
)
&&
$user
->
isDemoUser
())
{
return
Redirect
::
back
()
->
with
(
'error'
,
'Deleting the demo user is not allowed.'
);
}
$user
->
delete
();
return
Redirect
::
route
(
'users.edit'
,
$user
)
->
with
(
'success'
,
'User deleted.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'User deleted.'
);
}
public
function
restore
(
User
$user
)
{
$user
->
restore
();
return
Redirect
::
route
(
'users.edit'
,
$user
)
->
with
(
'success'
,
'User restored.'
);
return
Redirect
::
back
(
)
->
with
(
'success'
,
'User restored.'
);
}
}
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