Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
b986c66b
Commit
b986c66b
authored
Jun 03, 2018
by
Vipul Basapati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Settings Responsable trait implementation Complete
parent
addee78f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
28 deletions
+60
-28
PermissionController.php
...ollers/Backend/Access/Permission/PermissionController.php
+3
-3
RoleController.php
app/Http/Controllers/Backend/Access/Role/RoleController.php
+3
-3
UserController.php
app/Http/Controllers/Backend/Access/User/UserController.php
+3
-3
BlogsController.php
app/Http/Controllers/Backend/Blogs/BlogsController.php
+3
-3
MenuController.php
app/Http/Controllers/Backend/Menu/MenuController.php
+3
-3
PagesController.php
app/Http/Controllers/Backend/Pages/PagesController.php
+3
-3
SettingsController.php
app/Http/Controllers/Backend/Settings/SettingsController.php
+8
-9
EditResponse.php
app/Http/Responses/Backend/Setting/EditResponse.php
+33
-0
RedirectResponse.php
app/Http/Responses/RedirectResponse.php
+1
-1
No files found.
app/Http/Controllers/Backend/Access/Permission/PermissionController.php
View file @
b986c66b
...
@@ -63,7 +63,7 @@ class PermissionController extends Controller
...
@@ -63,7 +63,7 @@ class PermissionController extends Controller
{
{
$this
->
permissions
->
create
(
$request
->
all
());
$this
->
permissions
->
create
(
$request
->
all
());
return
new
RedirectResponse
(
'admin.access.permission.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.permissions.created'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.permission.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.permissions.created'
)]);
}
}
/**
/**
...
@@ -87,7 +87,7 @@ class PermissionController extends Controller
...
@@ -87,7 +87,7 @@ class PermissionController extends Controller
{
{
$this
->
permissions
->
update
(
$permission
,
$request
->
all
());
$this
->
permissions
->
update
(
$permission
,
$request
->
all
());
return
new
RedirectResponse
(
'admin.access.permission.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.permissions.updated'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.permission.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.permissions.updated'
)]);
}
}
/**
/**
...
@@ -100,6 +100,6 @@ class PermissionController extends Controller
...
@@ -100,6 +100,6 @@ class PermissionController extends Controller
{
{
$this
->
permissions
->
delete
(
$permission
);
$this
->
permissions
->
delete
(
$permission
);
return
new
RedirectResponse
(
'admin.access.permission.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.permissions.deleted'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.permission.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.permissions.deleted'
)]);
}
}
}
}
app/Http/Controllers/Backend/Access/Role/RoleController.php
View file @
b986c66b
...
@@ -71,7 +71,7 @@ class RoleController extends Controller
...
@@ -71,7 +71,7 @@ class RoleController extends Controller
{
{
$this
->
roles
->
create
(
$request
->
all
());
$this
->
roles
->
create
(
$request
->
all
());
return
new
RedirectResponse
(
'admin.access.role.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.roles.created'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.role.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.roles.created'
)]);
}
}
/**
/**
...
@@ -95,7 +95,7 @@ class RoleController extends Controller
...
@@ -95,7 +95,7 @@ class RoleController extends Controller
{
{
$this
->
roles
->
update
(
$role
,
$request
->
all
());
$this
->
roles
->
update
(
$role
,
$request
->
all
());
return
new
RedirectResponse
(
'admin.access.role.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.roles.updated'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.role.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.roles.updated'
)]);
}
}
/**
/**
...
@@ -108,6 +108,6 @@ class RoleController extends Controller
...
@@ -108,6 +108,6 @@ class RoleController extends Controller
{
{
$this
->
roles
->
delete
(
$role
);
$this
->
roles
->
delete
(
$role
);
return
new
RedirectResponse
(
'admin.access.role.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.roles.deleted'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.role.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.roles.deleted'
)]);
}
}
}
}
app/Http/Controllers/Backend/Access/User/UserController.php
View file @
b986c66b
...
@@ -76,7 +76,7 @@ class UserController extends Controller
...
@@ -76,7 +76,7 @@ class UserController extends Controller
{
{
$this
->
users
->
create
(
$request
);
$this
->
users
->
create
(
$request
);
return
new
RedirectResponse
(
'admin.access.user.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.users.created'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.user.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.users.created'
)]);
}
}
/**
/**
...
@@ -114,7 +114,7 @@ class UserController extends Controller
...
@@ -114,7 +114,7 @@ class UserController extends Controller
{
{
$this
->
users
->
update
(
$user
,
$request
);
$this
->
users
->
update
(
$user
,
$request
);
return
new
RedirectResponse
(
'admin.access.user.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.users.updated'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.user.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.users.updated'
)]);
}
}
/**
/**
...
@@ -127,6 +127,6 @@ class UserController extends Controller
...
@@ -127,6 +127,6 @@ class UserController extends Controller
{
{
$this
->
users
->
delete
(
$user
);
$this
->
users
->
delete
(
$user
);
return
new
RedirectResponse
(
'admin.access.user.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.users.deleted'
)]);
return
new
RedirectResponse
(
route
(
'admin.access.user.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.users.deleted'
)]);
}
}
}
}
app/Http/Controllers/Backend/Blogs/BlogsController.php
View file @
b986c66b
...
@@ -75,7 +75,7 @@ class BlogsController extends Controller
...
@@ -75,7 +75,7 @@ class BlogsController extends Controller
{
{
$this
->
blog
->
create
(
$request
->
except
(
'_token'
));
$this
->
blog
->
create
(
$request
->
except
(
'_token'
));
return
new
RedirectResponse
(
'admin.blogs.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.created'
)]);
return
new
RedirectResponse
(
route
(
'admin.blogs.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.created'
)]);
}
}
/**
/**
...
@@ -104,7 +104,7 @@ class BlogsController extends Controller
...
@@ -104,7 +104,7 @@ class BlogsController extends Controller
$this
->
blog
->
update
(
$blog
,
$request
->
except
([
'_token'
,
'_method'
]));
$this
->
blog
->
update
(
$blog
,
$request
->
except
([
'_token'
,
'_method'
]));
return
new
RedirectResponse
(
'admin.blogs.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.updated'
)]);
return
new
RedirectResponse
(
route
(
'admin.blogs.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.updated'
)]);
}
}
/**
/**
...
@@ -117,6 +117,6 @@ class BlogsController extends Controller
...
@@ -117,6 +117,6 @@ class BlogsController extends Controller
{
{
$this
->
blog
->
delete
(
$blog
);
$this
->
blog
->
delete
(
$blog
);
return
new
RedirectResponse
(
'admin.blogs.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.deleted'
)]);
return
new
RedirectResponse
(
route
(
'admin.blogs.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.deleted'
)]);
}
}
}
}
app/Http/Controllers/Backend/Menu/MenuController.php
View file @
b986c66b
...
@@ -92,7 +92,7 @@ class MenuController extends Controller
...
@@ -92,7 +92,7 @@ class MenuController extends Controller
{
{
$this
->
menu
->
create
(
$request
->
except
(
'_token'
));
$this
->
menu
->
create
(
$request
->
except
(
'_token'
));
return
new
RedirectResponse
(
'admin.menus.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.menus.created'
)]);
return
new
RedirectResponse
(
route
(
'admin.menus.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.menus.created'
)]);
}
}
/**
/**
...
@@ -120,7 +120,7 @@ class MenuController extends Controller
...
@@ -120,7 +120,7 @@ class MenuController extends Controller
{
{
$this
->
menu
->
update
(
$menu
,
$request
->
all
());
$this
->
menu
->
update
(
$menu
,
$request
->
all
());
return
new
RedirectResponse
(
'admin.menus.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.menus.updated'
)]);
return
new
RedirectResponse
(
route
(
'admin.menus.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.menus.updated'
)]);
}
}
/**
/**
...
@@ -135,6 +135,6 @@ class MenuController extends Controller
...
@@ -135,6 +135,6 @@ class MenuController extends Controller
{
{
$this
->
menu
->
delete
(
$menu
);
$this
->
menu
->
delete
(
$menu
);
return
new
RedirectResponse
(
'admin.menus.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.menus.deleted'
)]);
return
new
RedirectResponse
(
route
(
'admin.menus.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.menus.deleted'
)]);
}
}
}
}
app/Http/Controllers/Backend/Pages/PagesController.php
View file @
b986c66b
...
@@ -59,7 +59,7 @@ class PagesController extends Controller
...
@@ -59,7 +59,7 @@ class PagesController extends Controller
{
{
$this
->
pages
->
create
(
$request
->
except
([
'_token'
]));
$this
->
pages
->
create
(
$request
->
except
([
'_token'
]));
return
new
RedirectResponse
(
'admin.pages.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.pages.created'
)]);
return
new
RedirectResponse
(
route
(
'admin.pages.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.pages.created'
)]);
}
}
/**
/**
...
@@ -83,7 +83,7 @@ class PagesController extends Controller
...
@@ -83,7 +83,7 @@ class PagesController extends Controller
{
{
$this
->
pages
->
update
(
$page
,
$request
->
except
([
'_method'
,
'_token'
]));
$this
->
pages
->
update
(
$page
,
$request
->
except
([
'_method'
,
'_token'
]));
return
new
RedirectResponse
(
'admin.pages.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.pages.updated'
)]);
return
new
RedirectResponse
(
route
(
'admin.pages.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.pages.updated'
)]);
}
}
/**
/**
...
@@ -96,6 +96,6 @@ class PagesController extends Controller
...
@@ -96,6 +96,6 @@ class PagesController extends Controller
{
{
$this
->
pages
->
delete
(
$page
);
$this
->
pages
->
delete
(
$page
);
return
new
RedirectResponse
(
'admin.pages.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.pages.deleted'
)]);
return
new
RedirectResponse
(
route
(
'admin.pages.index'
)
,
[
'flash_success'
=>
trans
(
'alerts.backend.pages.deleted'
)]);
}
}
}
}
app/Http/Controllers/Backend/Settings/SettingsController.php
View file @
b986c66b
...
@@ -2,11 +2,13 @@
...
@@ -2,11 +2,13 @@
namespace
App\Http\Controllers\Backend\Settings
;
namespace
App\Http\Controllers\Backend\Settings
;
use
App\Models\Settings\Setting
;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Controller
;
use
App\Http\Responses\RedirectResponse
;
use
App\Http\Responses\Backend\Setting\EditResponse
;
use
App\Repositories\Backend\Settings\SettingsRepository
;
use
App\Http\Requests\Backend\Settings\ManageSettingsRequest
;
use
App\Http\Requests\Backend\Settings\ManageSettingsRequest
;
use
App\Http\Requests\Backend\Settings\UpdateSettingsRequest
;
use
App\Http\Requests\Backend\Settings\UpdateSettingsRequest
;
use
App\Models\Settings\Setting
;
use
App\Repositories\Backend\Settings\SettingsRepository
;
/**
/**
* Class SettingsController.
* Class SettingsController.
...
@@ -27,26 +29,23 @@ class SettingsController extends Controller
...
@@ -27,26 +29,23 @@ class SettingsController extends Controller
* @param \App\Models\Settings\Setting $setting
* @param \App\Models\Settings\Setting $setting
* @param \App\Http\Requests\Backend\Settings\ManageSettingsRequest $request
* @param \App\Http\Requests\Backend\Settings\ManageSettingsRequest $request
*
*
* @return
mixed
* @return
\App\Http\Responses\Backend\Setting\EditResponse
*/
*/
public
function
edit
(
Setting
$setting
,
ManageSettingsRequest
$request
)
public
function
edit
(
Setting
$setting
,
ManageSettingsRequest
$request
)
{
{
return
view
(
'backend.settings.edit'
)
return
new
EditResponse
(
$setting
);
->
withSetting
(
$setting
);
}
}
/**
/**
* @param \App\Models\Settings\Setting $setting
* @param \App\Models\Settings\Setting $setting
* @param \App\Http\Requests\Backend\Settings\UpdateSettingsRequest $request
* @param \App\Http\Requests\Backend\Settings\UpdateSettingsRequest $request
*
*
* @return
mixed
* @return
\App\Http\Responses\RedirectResponse
*/
*/
public
function
update
(
Setting
$setting
,
UpdateSettingsRequest
$request
)
public
function
update
(
Setting
$setting
,
UpdateSettingsRequest
$request
)
{
{
$this
->
settings
->
update
(
$setting
,
$request
->
except
([
'_token'
,
'_method'
]));
$this
->
settings
->
update
(
$setting
,
$request
->
except
([
'_token'
,
'_method'
]));
return
redirect
()
return
new
RedirectResponse
(
route
(
'admin.settings.edit'
,
$setting
->
id
),
[
'flash_success'
=>
trans
(
'alerts.backend.settings.updated'
)]);
->
route
(
'admin.settings.edit'
,
$setting
->
id
)
->
with
(
'flash_success'
,
trans
(
'alerts.backend.settings.updated'
));
}
}
}
}
app/Http/Responses/Backend/
Page/Create
Response.php
→
app/Http/Responses/Backend/
Setting/Edit
Response.php
View file @
b986c66b
<?php
<?php
namespace
App\Http\Responses\Backend\
Page
;
namespace
App\Http\Responses\Backend\
Setting
;
use
Illuminate\Contracts\Support\Responsable
;
use
Illuminate\Contracts\Support\Responsable
;
class
Create
Response
implements
Responsable
class
Edit
Response
implements
Responsable
{
{
/**
/**
* In Response.
* @var \App\Models\Settings\Setting
*
*/
* @param \App\Http\Requests\Request $request
protected
$setting
;
/**
* @param \App\Models\Settings\Setting $setting
*/
public
function
__construct
(
$setting
)
{
$this
->
setting
=
$setting
;
}
/**
* toReponse
*
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
*/
public
function
toResponse
(
$request
)
public
function
toResponse
(
$request
)
{
{
//
return
view
(
'backend.settings.edit'
)
->
withSetting
(
$this
->
setting
);
}
}
}
}
app/Http/Responses/RedirectResponse.php
View file @
b986c66b
...
@@ -18,7 +18,7 @@ class RedirectResponse implements Responsable
...
@@ -18,7 +18,7 @@ class RedirectResponse implements Responsable
public
function
toResponse
(
$request
)
public
function
toResponse
(
$request
)
{
{
return
redirect
()
return
redirect
()
->
route
(
$this
->
route
)
->
to
(
$this
->
route
)
->
with
(
$this
->
message
);
->
with
(
$this
->
message
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment