Skip to content

Commit 9250b40

Browse files
authored
Merge pull request #387 from viralsolani/develop
Merge Develop branch..
2 parents 431752c + 322f248 commit 9250b40

File tree

31 files changed

+2423
-3281
lines changed

31 files changed

+2423
-3281
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
APP_NAME="Laravel Admin Panel"
22
APP_SHORT_NAME="LAP"
33
APP_ENV=local
4-
APP_KEY=base64:O+TrollIDwasHEREtMG9kBc+/Q32exQLusNVhnq558w=
4+
APP_KEY=
55
APP_DEBUG=true
66
APP_LOG_LEVEL=debug
77
APP_URL=http://localhost
@@ -21,6 +21,7 @@ REQUIRES_APPROVAL=false
2121
BROADCAST_DRIVER=log
2222
CACHE_DRIVER=file
2323
SESSION_DRIVER=file
24+
SESSION_LIFETIME=120
2425
QUEUE_DRIVER=sync
2526

2627
#Session Timeout

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ public/img/backend/blog_images/*
3636
public/mix-manifest.json
3737
public/access.log
3838
public/error.log
39-
!public/js/jquerysession.min.js
39+
!public/js/jquerysession.min.js
40+
output.txt
41+
.php_cs.cache

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ You can now access the server at http://localhost:8000
115115

116116
- To run test cases, add SQLite support to your php
117117

118+
## Other Important Commands
119+
- To fix php coding standard issues run - composer format
120+
- To perform various self diagnosis tests on your Laravel application. run - php artisan self-diagnosis
121+
- To clear all cache run - composer clear-all
122+
- To built Cache run - composer cache-all
123+
- To clear and built cache run - composer cc
124+
118125
## Logging In
119126

120127
`php artisan db:seed` adds three users with respective roles. The credentials are as follows:

app/Http/Controllers/Api/V1/BlogTagsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function update(Request $request, BlogTag $blog_tag)
8282
$validation = $this->validatingRequest($request, $blog_tag->id);
8383

8484
if ($validation->fails()) {
85-
return $this->throwValidation($validation);
85+
return $this->throwValidation($validation->messages()->first());
8686
}
8787

8888
$this->repository->update($blog_tag, $request->all());

app/Http/Controllers/Api/V1/PagesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function index(Request $request)
3131
{
3232
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
3333
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
34-
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : config('module.pages.table', 'pages').'created_at';
34+
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : config('module.pages.table', 'pages').'.created_at';
3535

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

app/Http/Middleware/RedirectIfAuthenticated.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ public function handle($request, Closure $next, $guard = null)
2222
return redirect('/');
2323
}
2424

25+
if ($request->wantsJson() && auth()->guard('api')->user()) {
26+
return response([
27+
'error' => [
28+
'message' => 'Not allowed',
29+
'status_code' => 403,
30+
],
31+
], 403);
32+
}
33+
2534
return $next($request);
2635
}
2736
}

app/Models/Access/User/Traits/Attribute/UserAttribute.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,13 @@ public function getLoginAsButtonAttribute($class)
229229
if (access()->allow('login-as-user') && (!session()->has('admin_user_id') || !session()->has('temp_user_id'))) {
230230
//Won't break, but don't let them "Login As" themselves
231231
if ($this->id != access()->id()) {
232-
return '<a class="'.$class.'" href="'.route('admin.access.user.login-as',
233-
$this).'"><i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.login_as',
234-
['user' => $this->name]).'"></i>'.$name.'</a>';
232+
return '<a class="'.$class.'" href="'.route(
233+
'admin.access.user.login-as',
234+
$this
235+
).'"><i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="'.trans(
236+
'buttons.backend.access.users.login_as',
237+
['user' => $this->name]
238+
).'"></i>'.$name.'</a>';
235239
}
236240
}
237241

app/Models/Faqs/Traits/Attribute/FaqAttribute.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ public function getStatusButtonAttribute()
1515
switch ($this->status && access()->allow('edit-faq')) {
1616
case 0:
1717
return '<a href="'.route('admin.faqs.mark', [$this, 1]).'" class="btn btn-flat btn-default"><i class="fa fa-check-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.activate').'"></i></a>';
18-
// No break
1918

2019
case 1:
2120
return '<a href="'.route('admin.faqs.mark', [$this, 0]).'" class="btn btn-flat btn-default"><i class="fa fa-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.deactivate').'"></i></a>';
22-
// No break
2321

2422
default:
2523
return '';
26-
// No break
2724
}
2825

2926
return '';

app/Providers/ComposerServiceProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public function boot()
2323
*/
2424
View::composer(
2525
// This class binds the $logged_in_user variable to every view
26-
'*', GlobalComposer::class
26+
'*',
27+
GlobalComposer::class
2728
);
2829

2930
/*

client/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": [["@babel/preset-env"] ]
3+
}

0 commit comments

Comments
 (0)