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
dd729881
Commit
dd729881
authored
Apr 30, 2018
by
bvipul
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/bvipul/laravel-adminpanel
into develop
parents
d1214bd4
9044ce45
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
127 additions
and
44 deletions
+127
-44
.env.example
.env.example
+2
-0
BlogsController.php
app/Http/Controllers/Backend/Blogs/BlogsController.php
+10
-28
CreateResponse.php
app/Http/Responses/Backend/Blog/CreateResponse.php
+29
-0
EditResponse.php
app/Http/Responses/Backend/Blog/EditResponse.php
+37
-0
IndexResponse.php
app/Http/Responses/Backend/Blog/IndexResponse.php
+23
-0
RedirectResponse.php
app/Http/Responses/RedirectResponse.php
+25
-0
mail.php
config/mail.php
+1
-1
ManageBlogCategoriesTest.php
tests/Feature/Backend/ManageBlogCategoriesTest.php
+0
-1
ManageBlogTagsTest.php
tests/Feature/Backend/ManageBlogTagsTest.php
+0
-1
ManageBlogsTest.php
tests/Feature/Backend/ManageBlogsTest.php
+0
-1
ManageFaqsTest.php
tests/Feature/Backend/ManageFaqsTest.php
+0
-1
ManagePermissionsTest.php
tests/Feature/Backend/ManagePermissionsTest.php
+0
-1
ManageRolesTest.php
tests/Feature/Backend/ManageRolesTest.php
+0
-1
ManageUsersTest.php
tests/Feature/Backend/ManageUsersTest.php
+0
-3
LoggedOutRouteTest.php
tests/Feature/Frontend/LoggedOutRouteTest.php
+0
-6
No files found.
.env.example
View file @
dd729881
...
...
@@ -28,6 +28,8 @@ REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_FROM=viral.solani@gmail.com
MAIL_FROM_NAME=Admin
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
...
...
app/Http/Controllers/Backend/Blogs/BlogsController.php
View file @
dd729881
...
...
@@ -6,6 +6,10 @@ use App\Http\Controllers\Controller;
use
App\Http\Requests\Backend\Blogs\ManageBlogsRequest
;
use
App\Http\Requests\Backend\Blogs\StoreBlogsRequest
;
use
App\Http\Requests\Backend\Blogs\UpdateBlogsRequest
;
use
App\Http\Responses\Backend\Blog\IndexResponse
;
use
App\Http\Responses\Backend\Blog\CreateResponse
;
use
App\Http\Responses\Backend\Blog\EditResponse
;
use
App\Http\Responses\RedirectResponse
;
use
App\Models\BlogCategories\BlogCategory
;
use
App\Models\Blogs\Blog
;
use
App\Models\BlogTags\BlogTag
;
...
...
@@ -46,9 +50,7 @@ class BlogsController extends Controller
*/
public
function
index
(
ManageBlogsRequest
$request
)
{
return
view
(
'backend.blogs.index'
)
->
with
([
'status'
=>
$this
->
status
,
]);
return
new
IndexResponse
(
$this
->
status
);
}
/**
...
...
@@ -61,11 +63,7 @@ class BlogsController extends Controller
$blogTags
=
BlogTag
::
getSelectData
();
$blogCategories
=
BlogCategory
::
getSelectData
();
return
view
(
'backend.blogs.create'
)
->
with
([
'blogCategories'
=>
$blogCategories
,
'blogTags'
=>
$blogTags
,
'status'
=>
$this
->
status
,
]);
return
new
CreateResponse
(
$this
->
status
,
$blogCategories
,
$blogTags
);
}
/**
...
...
@@ -77,9 +75,7 @@ class BlogsController extends Controller
{
$this
->
blog
->
create
(
$request
->
except
(
'_token'
));
return
redirect
()
->
route
(
'admin.blogs.index'
)
->
with
(
'flash_success'
,
trans
(
'alerts.backend.blogs.created'
));
return
new
RedirectResponse
(
'admin.blogs.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.created'
)]);
}
/**
...
...
@@ -93,17 +89,7 @@ class BlogsController extends Controller
$blogCategories
=
BlogCategory
::
getSelectData
();
$blogTags
=
BlogTag
::
getSelectData
();
$selectedCategories
=
$blog
->
categories
->
pluck
(
'id'
)
->
toArray
();
$selectedtags
=
$blog
->
tags
->
pluck
(
'id'
)
->
toArray
();
return
view
(
'backend.blogs.edit'
)
->
with
([
'blog'
=>
$blog
,
'blogCategories'
=>
$blogCategories
,
'blogTags'
=>
$blogTags
,
'selectedCategories'
=>
$selectedCategories
,
'selectedtags'
=>
$selectedtags
,
'status'
=>
$this
->
status
,
]);
return
new
EditResponse
(
$blog
,
$this
->
status
,
$blogCategories
,
$blogTags
);
}
/**
...
...
@@ -118,9 +104,7 @@ class BlogsController extends Controller
$this
->
blog
->
update
(
$blog
,
$request
->
except
([
'_token'
,
'_method'
]));
return
redirect
()
->
route
(
'admin.blogs.index'
)
->
with
(
'flash_success'
,
trans
(
'alerts.backend.blogs.updated'
));
return
new
RedirectResponse
(
'admin.blogs.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.updated'
)]);
}
/**
...
...
@@ -133,8 +117,6 @@ class BlogsController extends Controller
{
$this
->
blog
->
delete
(
$blog
);
return
redirect
()
->
route
(
'admin.blogs.index'
)
->
with
(
'flash_success'
,
trans
(
'alerts.backend.blogs.deleted'
));
return
new
RedirectResponse
(
'admin.blogs.index'
,
[
'flash_success'
=>
trans
(
'alerts.backend.blogs.deleted'
)]);
}
}
app/Http/Responses/Backend/Blog/CreateResponse.php
0 → 100644
View file @
dd729881
<?php
namespace
App\Http\Responses\Backend\Blog
;
use
Illuminate\Contracts\Support\Responsable
;
class
CreateResponse
implements
Responsable
{
protected
$status
,
$blogTags
,
$blogCategories
;
public
function
__construct
(
$status
,
$blogCategories
,
$blogTags
)
{
$this
->
status
=
$status
;
$this
->
blogTags
=
$blogTags
;
$this
->
blogCategories
=
$blogCategories
;
}
public
function
toResponse
(
$request
)
{
return
view
(
'backend.blogs.create'
)
->
with
([
'blogCategories'
=>
$this
->
blogCategories
,
'blogTags'
=>
$this
->
blogTags
,
'status'
=>
$this
->
status
,
]);
}
}
\ No newline at end of file
app/Http/Responses/Backend/Blog/EditResponse.php
0 → 100644
View file @
dd729881
<?php
namespace
App\Http\Responses\Backend\Blog
;
use
Illuminate\Contracts\Support\Responsable
;
class
EditResponse
implements
Responsable
{
protected
$blog
,
$status
,
$blogTags
,
$blogCategories
;
public
function
__construct
(
$blog
,
$status
,
$blogCategories
,
$blogTags
)
{
$this
->
blog
=
$blog
;
$this
->
status
=
$status
;
$this
->
blogTags
=
$blogTags
;
$this
->
blogCategories
=
$blogCategories
;
}
public
function
toResponse
(
$request
)
{
$selectedCategories
=
$this
->
blog
->
categories
->
pluck
(
'id'
)
->
toArray
();
$selectedtags
=
$this
->
blog
->
tags
->
pluck
(
'id'
)
->
toArray
();
return
view
(
'backend.blogs.edit'
)
->
with
([
'blog'
=>
$this
->
blog
,
'blogCategories'
=>
$this
->
blogCategories
,
'blogTags'
=>
$this
->
blogTags
,
'selectedCategories'
=>
$selectedCategories
,
'selectedtags'
=>
$selectedtags
,
'status'
=>
$this
->
status
,
]);
}
}
\ No newline at end of file
app/Http/Responses/Backend/Blog/IndexResponse.php
0 → 100644
View file @
dd729881
<?php
namespace
App\Http\Responses\Backend\Blog
;
use
Illuminate\Contracts\Support\Responsable
;
class
IndexResponse
implements
Responsable
{
protected
$status
;
public
function
__construct
(
$status
)
{
$this
->
status
=
$status
;
}
public
function
toResponse
(
$request
)
{
return
view
(
'backend.blogs.index'
)
->
with
([
'status'
=>
$this
->
status
,
]);
}
}
\ No newline at end of file
app/Http/Responses/RedirectResponse.php
0 → 100644
View file @
dd729881
<?php
namespace
App\Http\Responses
;
use
Illuminate\Contracts\Support\Responsable
;
class
RedirectResponse
implements
Responsable
{
protected
$route
,
$message
;
public
function
__construct
(
$route
,
$message
)
{
$this
->
route
=
$route
;
$this
->
message
=
$message
;
}
public
function
toResponse
(
$request
)
{
return
redirect
()
->
route
(
$this
->
route
)
->
with
(
$this
->
message
);
}
}
\ No newline at end of file
config/mail.php
View file @
dd729881
...
...
@@ -56,7 +56,7 @@ return [
*/
'from'
=>
[
'address'
=>
env
(
'MAIL_
USERNAME
'
,
'viral.solani@gmail.com'
),
'address'
=>
env
(
'MAIL_
FROM
'
,
'viral.solani@gmail.com'
),
'name'
=>
env
(
'MAIL_FROM_NAME'
,
'Admin'
),
],
...
...
tests/Feature/Backend/ManageBlogCategoriesTest.php
View file @
dd729881
...
...
@@ -16,7 +16,6 @@ class ManageBlogCategoriesTest extends TestCase
->
assertSee
(
trans
(
'labels.backend.blogcategories.management'
))
->
assertSee
(
trans
(
'labels.backend.blogcategories.table.title'
))
->
assertSee
(
trans
(
'labels.backend.blogcategories.table.status'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
tests/Feature/Backend/ManageBlogTagsTest.php
View file @
dd729881
...
...
@@ -16,7 +16,6 @@ class ManageBlogTagsTest extends TestCase
->
assertSee
(
trans
(
'labels.backend.blogtags.management'
))
->
assertSee
(
trans
(
'labels.backend.blogtags.table.title'
))
->
assertSee
(
trans
(
'labels.backend.blogtags.table.status'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
tests/Feature/Backend/ManageBlogsTest.php
View file @
dd729881
...
...
@@ -39,7 +39,6 @@ class ManageBlogsTest extends TestCase
->
assertSee
(
trans
(
'labels.backend.blogs.table.createdby'
))
->
assertSee
(
trans
(
'labels.backend.blogs.table.createdat'
))
->
assertSee
(
trans
(
'labels.backend.blogs.table.status'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
tests/Feature/Backend/ManageFaqsTest.php
View file @
dd729881
...
...
@@ -17,7 +17,6 @@ class ManageFaqsTest extends TestCase
->
assertSee
(
trans
(
'labels.backend.faqs.table.question'
))
->
assertSee
(
trans
(
'labels.backend.faqs.table.answer'
))
->
assertSee
(
trans
(
'labels.backend.faqs.table.status'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
tests/Feature/Backend/ManagePermissionsTest.php
View file @
dd729881
...
...
@@ -18,7 +18,6 @@ class ManagePermissionsTest extends TestCase
->
get
(
route
(
'admin.access.permission.index'
))
->
assertViewIs
(
'backend.access.permissions.index'
)
->
assertSee
(
trans
(
'labels.backend.access.permissions.management'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
tests/Feature/Backend/ManageRolesTest.php
View file @
dd729881
...
...
@@ -20,7 +20,6 @@ class ManageRolesTest extends TestCase
->
get
(
route
(
'admin.access.role.index'
))
->
assertViewIs
(
'backend.access.roles.index'
)
->
assertSee
(
trans
(
'labels.backend.access.roles.management'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
tests/Feature/Backend/ManageUsersTest.php
View file @
dd729881
...
...
@@ -44,7 +44,6 @@ class ManageUsersTest extends TestCase
->
assertViewIs
(
'backend.access.users.index'
)
->
assertSee
(
trans
(
'labels.backend.access.users.management'
))
->
assertSee
(
trans
(
'labels.backend.access.users.active'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
@@ -56,7 +55,6 @@ class ManageUsersTest extends TestCase
->
assertViewIs
(
'backend.access.users.deactivated'
)
->
assertSee
(
trans
(
'labels.backend.access.users.management'
))
->
assertSee
(
trans
(
'labels.backend.access.users.deactivated'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
@@ -68,7 +66,6 @@ class ManageUsersTest extends TestCase
->
assertViewIs
(
'backend.access.users.deleted'
)
->
assertSee
(
trans
(
'labels.backend.access.users.management'
))
->
assertSee
(
trans
(
'labels.backend.access.users.deleted'
))
->
assertSee
(
'Export'
)
->
assertSee
(
'Action'
);
}
...
...
tests/Feature/Frontend/LoggedOutRouteTest.php
View file @
dd729881
...
...
@@ -24,12 +24,6 @@ class LoggedOutRouteTest extends BrowserKitTestCase
$this
->
visit
(
'/'
)
->
assertResponseOk
();
}
/** @test */
public
function
test_macroPage
()
{
$this
->
visit
(
'/macros'
)
->
see
(
'Macro Examples'
);
}
/** @test */
public
function
testLoginPage
()
{
...
...
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