Skip to content

Commit

Permalink
Merge pull request #246 from viralsolani/develop
Browse files Browse the repository at this point in the history
Merge Develop to master
  • Loading branch information
viralsolani authored Jul 9, 2018
2 parents dafb3a3 + e38cf42 commit 811f969
Show file tree
Hide file tree
Showing 39 changed files with 3,187 additions and 3,144 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Generate a new application key

php artisan key:generate

Generate a new JWT secret key (If you want to use API)
php artisan jwt:secret

Generate a new JWT authentication secret key

php artisan jwt:secret
Expand All @@ -79,7 +82,7 @@ For generating the files of unisharp file manager
php artisan vendor:publish --tag=lfm_public

For linking storage folder in public

php artisan storage:link

Start the local development server
Expand Down
Empty file.
16 changes: 8 additions & 8 deletions app/Http/Breadcrumbs/Backend/Blog_Category.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

Breadcrumbs::register('admin.blogcategories.index', function ($breadcrumbs) {
Breadcrumbs::register('admin.blogCategories.index', function ($breadcrumbs) {
$breadcrumbs->parent('admin.dashboard');
$breadcrumbs->push(trans('menus.backend.blogcategories.management'), route('admin.blogcategories.index'));
$breadcrumbs->push(trans('menus.backend.blogcategories.management'), route('admin.blogCategories.index'));
});

Breadcrumbs::register('admin.blogcategories.create', function ($breadcrumbs) {
$breadcrumbs->parent('admin.blogcategories.index');
$breadcrumbs->push(trans('menus.backend.blogcategories.create'), route('admin.blogcategories.create'));
Breadcrumbs::register('admin.blogCategories.create', function ($breadcrumbs) {
$breadcrumbs->parent('admin.blogCategories.index');
$breadcrumbs->push(trans('menus.backend.blogcategories.create'), route('admin.blogCategories.create'));
});

Breadcrumbs::register('admin.blogcategories.edit', function ($breadcrumbs, $id) {
$breadcrumbs->parent('admin.blogcategories.index');
$breadcrumbs->push(trans('menus.backend.blogcategories.edit'), route('admin.blogcategories.edit', $id));
Breadcrumbs::register('admin.blogCategories.edit', function ($breadcrumbs, $id) {
$breadcrumbs->parent('admin.blogCategories.index');
$breadcrumbs->push(trans('menus.backend.blogcategories.edit'), route('admin.blogCategories.edit', $id));
});
16 changes: 8 additions & 8 deletions app/Http/Breadcrumbs/Backend/Blog_Tag.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

Breadcrumbs::register('admin.blogtags.index', function ($breadcrumbs) {
Breadcrumbs::register('admin.blogTags.index', function ($breadcrumbs) {
$breadcrumbs->parent('admin.dashboard');
$breadcrumbs->push(trans('menus.backend.blogtags.management'), route('admin.blogtags.index'));
$breadcrumbs->push(trans('menus.backend.blogtags.management'), route('admin.blogTags.index'));
});

Breadcrumbs::register('admin.blogtags.create', function ($breadcrumbs) {
$breadcrumbs->parent('admin.blogtags.index');
$breadcrumbs->push(trans('menus.backend.blogtags.create'), route('admin.blogtags.create'));
Breadcrumbs::register('admin.blogTags.create', function ($breadcrumbs) {
$breadcrumbs->parent('admin.blogTags.index');
$breadcrumbs->push(trans('menus.backend.blogtags.create'), route('admin.blogTags.create'));
});

Breadcrumbs::register('admin.blogtags.edit', function ($breadcrumbs, $id) {
$breadcrumbs->parent('admin.blogtags.index');
$breadcrumbs->push(trans('menus.backend.blogtags.edit'), route('admin.blogtags.edit', $id));
Breadcrumbs::register('admin.blogTags.edit', function ($breadcrumbs, $id) {
$breadcrumbs->parent('admin.blogTags.index');
$breadcrumbs->push(trans('menus.backend.blogtags.edit'), route('admin.blogTags.edit', $id));
});
4 changes: 3 additions & 1 deletion app/Http/Controllers/Api/V1/BlogCategoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public function __construct(BlogCategoriesRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return BlogCategoriesResource::collection(
$this->repository->getForDataTable()->paginate($limit)
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Api/V1/BlogTagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ public function __construct(BlogTagsRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return BlogTagsResource::collection(
$this->repository->getForDataTable()->paginate($limit)
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Api/V1/BlogsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ public function __construct(BlogsRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return BlogsResource::collection(
$this->repository->getForDataTable()->paginate($limit)
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Api/V1/DeactivatedUsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ public function __construct(UserRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return UserResource::collection(
$this->repository->getForDataTable(0, false)->paginate($limit)
$this->repository->getForDataTable(0, false)->orderBy($sortBy, $orderBy)->paginate($limit)
);
}
}
4 changes: 3 additions & 1 deletion app/Http/Controllers/Api/V1/DeletedUsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ public function __construct(UserRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return UserResource::collection(
$this->repository->getForDataTable(0, true)->paginate($limit)
$this->repository->getForDataTable(0, true)->orderBy($sortBy, $orderBy)->paginate($limit)
);
}
}
4 changes: 3 additions & 1 deletion app/Http/Controllers/Api/V1/FaqsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ public function __construct(FaqsRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return FaqsResource::collection(
$this->repository->getForDataTable()->paginate($limit)
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Api/V1/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ public function __construct(PagesRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return PagesResource::collection(
$this->repository->getForDataTable()->paginate($limit)
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand Down
5 changes: 4 additions & 1 deletion app/Http/Controllers/Api/V1/PermissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public function __construct(PermissionRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return PermissionResource::collection(
$this->repository->getForDataTable()->paginate($limit)
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand Down Expand Up @@ -104,6 +106,7 @@ public function destroy(Permission $permission, Request $request)
$this->repository->delete($permission);

return $this->respond([
'data' => $permission->id,
'message' => trans('alerts.backend.permissions.deleted'),
]);
}
Expand Down
6 changes: 5 additions & 1 deletion app/Http/Controllers/Api/V1/RolesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public function __construct(RoleRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return RoleResource::collection(
$this->repository->getForDataTable()->paginate($limit)
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand All @@ -60,6 +62,7 @@ public function show(Role $role)
public function store(Request $request)
{
$validation = $this->validateRole($request);

if ($validation->fails()) {
return $this->throwValidation($validation->messages()->first());
}
Expand Down Expand Up @@ -105,6 +108,7 @@ public function destroy(Role $role, Request $request)
$this->repository->delete($role);

return $this->respond([
'data' => $role->id,
'message' => trans('alerts.backend.roles.deleted'),
]);
}
Expand Down
5 changes: 4 additions & 1 deletion app/Http/Controllers/Api/V1/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public function __construct(UserRepository $repository)
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';

return UserResource::collection(
$this->repository->getForDataTable(1, false)->paginate($limit)
$this->repository->getForDataTable(1, false)->orderBy($sortBy, $orderBy)->paginate($limit)
);
}

Expand Down Expand Up @@ -106,6 +108,7 @@ public function destroy(User $user, Request $request)
$this->repository->delete($user);

return $this->respond([
'data' => $user->id,
'message' => trans('alerts.backend.users.deleted'),
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Http\Requests\Backend\BlogCategories\ManageBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\StoreBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\UpdateBlogCategoriesRequest;
use App\Http\Responses\Backend\BlogCategory\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\BlogCategories\BlogCategory;
Expand Down Expand Up @@ -65,7 +66,7 @@ public function store(StoreBlogCategoriesRequest $request)
* @param \App\Models\BlogCategories\BlogCategory $blogCategory
* @param \App\Http\Requests\Backend\BlogCategories\EditBlogCategoriesRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\BlogCategory\EditResponse
*/
public function edit(BlogCategory $blogCategory, EditBlogCategoriesRequest $request)
{
Expand Down
8 changes: 0 additions & 8 deletions app/Http/Controllers/Frontend/FrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ public function index()
return view('frontend.index', compact('google_analytics', $google_analytics));
}

/**
* @return \Illuminate\View\View
*/
public function macros()
{
return view('frontend.macros');
}

/**
* show page by $page_slug.
*/
Expand Down
35 changes: 0 additions & 35 deletions app/Http/Middleware/VerifyJWTToken.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function authorize()
public function rules()
{
return [
'name' => 'required|max:191',
'name' => 'required|max:191|unique:blog_categories,name,'.$this->segment(3),
];
}

Expand All @@ -39,6 +39,7 @@ public function rules()
public function messages()
{
return [
'name.unique' => 'Blog category name already exists, please enter a different name.',
'name.required' => 'Blog category name must required',
'name.max' => 'Blog category may not be greater than 191 characters.',
];
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Requests/Backend/BlogTags/UpdateBlogTagsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function authorize()
public function rules()
{
return [
'name' => 'required|max:191',
'name' => 'required|max:191|unique:blog_tags,name,'.$this->segment(3),
];
}

Expand All @@ -39,6 +39,7 @@ public function rules()
public function messages()
{
return [
'name.unique' => 'Blog Tag name already exists, please enter a different name.',
'name.required' => 'Blog Tag name is a required field.',
'name.max' => 'Blog Tag may not be greater than 191 characters.',
];
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Requests/Backend/Blogs/UpdateBlogsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function authorize()
public function rules()
{
return [
'name' => 'required|max:191',
'name' => 'required|max:191|unique:blogs,name,'.$this->segment(3),
'content' => 'required',
'categories' => 'required',
'tags' => 'required',
Expand All @@ -42,6 +42,7 @@ public function rules()
public function messages()
{
return [
'name.unique' => 'Blog name already exists, please enter a different name.',
'name.required' => 'Please insert Blog Title',
'name.max' => 'Blog Title may not be greater than 191 characters.',
];
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public function toArray($request)
return [
'id' => $this->id,
'name' => $this->name,
'permission' => ($this->all) ? 'All' : optional($this->permissions)->pluck('display_name'),
'noofuses' => $this->users->count(),
'permissions' => ($this->all) ? 'All' : optional($this->permissions)->pluck('display_name'),
'number_of_users' => $this->users->count(),
'sort' => $this->sort,
'status' => $this->status,
'registered_at' => $this->created_at->toIso8601String(),
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public function toArray($request)
'role' => optional($this->roles()->first())->name,
'permissions' => $this->permissions()->get(),
'status' => $this->status,
'registered_at' => $this->created_at->toIso8601String(),
'last_updated_at' => $this->updated_at->toIso8601String(),
'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(),
];
}
}
4 changes: 2 additions & 2 deletions app/Http/Responses/Backend/BlogCategory/EditResponse.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Responses\Backend\Menu;
namespace App\Http\Responses\Backend\BlogCategory;

use Illuminate\Contracts\Support\Responsable;

Expand All @@ -14,7 +14,7 @@ class EditResponse implements Responsable
/**
* @param \App\Models\BlogCategories\BlogCategory $blogCategory
*/
public function __construct($blogCategory, $types, $modules)
public function __construct($blogCategory)
{
$this->blogCategory = $blogCategory;
}
Expand Down
Loading

0 comments on commit 811f969

Please sign in to comment.