Commit 142e846e authored by Viral Solani's avatar Viral Solani

- Add friendsofphp/php-cs-fixer

- Fix issues with the help of php-cs-fixer
- Add important scripts in composer.json
parent f7355a19
...@@ -36,4 +36,6 @@ public/img/backend/blog_images/* ...@@ -36,4 +36,6 @@ public/img/backend/blog_images/*
public/mix-manifest.json public/mix-manifest.json
public/access.log public/access.log
public/error.log public/error.log
!public/js/jquerysession.min.js !public/js/jquerysession.min.js
\ No newline at end of file output.txt
.php_cs.cache
\ No newline at end of file
...@@ -229,9 +229,13 @@ trait UserAttribute ...@@ -229,9 +229,13 @@ trait UserAttribute
if (access()->allow('login-as-user') && (!session()->has('admin_user_id') || !session()->has('temp_user_id'))) { if (access()->allow('login-as-user') && (!session()->has('admin_user_id') || !session()->has('temp_user_id'))) {
//Won't break, but don't let them "Login As" themselves //Won't break, but don't let them "Login As" themselves
if ($this->id != access()->id()) { if ($this->id != access()->id()) {
return '<a class="'.$class.'" href="'.route('admin.access.user.login-as', return '<a class="'.$class.'" href="'.route(
$this).'"><i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.login_as', 'admin.access.user.login-as',
['user' => $this->name]).'"></i>'.$name.'</a>'; $this
).'"><i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="'.trans(
'buttons.backend.access.users.login_as',
['user' => $this->name]
).'"></i>'.$name.'</a>';
} }
} }
......
...@@ -15,15 +15,12 @@ trait FaqAttribute ...@@ -15,15 +15,12 @@ trait FaqAttribute
switch ($this->status && access()->allow('edit-faq')) { switch ($this->status && access()->allow('edit-faq')) {
case 0: case 0:
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>'; 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>';
// No break
case 1: case 1:
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>'; 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>';
// No break
default: default:
return ''; return '';
// No break
} }
return ''; return '';
......
...@@ -23,7 +23,8 @@ class ComposerServiceProvider extends ServiceProvider ...@@ -23,7 +23,8 @@ class ComposerServiceProvider extends ServiceProvider
*/ */
View::composer( View::composer(
// This class binds the $logged_in_user variable to every view // This class binds the $logged_in_user variable to every view
'*', GlobalComposer::class '*',
GlobalComposer::class
); );
/* /*
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
"bvipul/generator": "^5.8.1", "bvipul/generator": "^5.8.1",
"codedungeon/phpunit-result-printer": "^0.19.10", "codedungeon/phpunit-result-printer": "^0.19.10",
"filp/whoops": "~2.0", "filp/whoops": "~2.0",
"friendsofphp/php-cs-fixer": "^2.10",
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
"laravel/telescope": "^2.0", "laravel/telescope": "^2.0",
"mockery/mockery": "1.2.2", "mockery/mockery": "1.2.2",
...@@ -74,6 +75,30 @@ ...@@ -74,6 +75,30 @@
"post-autoload-dump": [ "post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover" "@php artisan package:discover"
],
"clear-all": [
"@php artisan clear-compiled",
"@php artisan cache:clear",
"@php artisan route:clear",
"@php artisan view:clear",
"@php artisan config:clear",
"composer dumpautoload -o"
],
"cache-all": [
"@php artisan config:cache",
"@php artisan route:cache"
],
"cc": [
"composer clear-all",
"composer cache-all"
],
"format": [
"./vendor/bin/php-cs-fixer fix app/ --show-progress=estimating",
"./vendor/bin/php-cs-fixer fix config/ --show-progress=estimating",
"./vendor/bin/php-cs-fixer fix database/ --show-progress=estimating",
"./vendor/bin/php-cs-fixer fix resources/ --show-progress=estimating",
"./vendor/bin/php-cs-fixer fix routes/ --show-progress=estimating",
"./vendor/bin/php-cs-fixer fix tests/ --show-progress=estimating"
] ]
}, },
"config": { "config": {
......
This diff is collapsed.
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
window.Laravel = {!! json_encode([ 'csrfToken' => csrf_token() ]) !!}; window.Laravel = {!! json_encode([ 'csrfToken' => csrf_token() ]) !!};
</script> </script>
<?php <?php
if(!empty($google_analytics)){ if (!empty($google_analytics)) {
echo $google_analytics; echo $google_analytics;
} }
?> ?>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
]); ?> ]); ?>
</script> </script>
<?php <?php
if(!empty($google_analytics)){ if (!empty($google_analytics)) {
echo $google_analytics; echo $google_analytics;
} }
?> ?>
......
...@@ -12,7 +12,8 @@ class PermissionTest extends TestCase ...@@ -12,7 +12,8 @@ class PermissionTest extends TestCase
{ {
$permission = Permission::find(1); $permission = Permission::find(1);
$this->assertInstanceOf( $this->assertInstanceOf(
'Illuminate\Database\Eloquent\Collection', $permission->roles 'Illuminate\Database\Eloquent\Collection',
$permission->roles
); );
} }
} }
...@@ -10,7 +10,8 @@ class RoleTest extends TestCase ...@@ -10,7 +10,8 @@ class RoleTest extends TestCase
public function a_role_has_users() public function a_role_has_users()
{ {
$this->assertInstanceOf( $this->assertInstanceOf(
'Illuminate\Database\Eloquent\Collection', $this->adminRole->users 'Illuminate\Database\Eloquent\Collection',
$this->adminRole->users
); );
} }
...@@ -18,7 +19,8 @@ class RoleTest extends TestCase ...@@ -18,7 +19,8 @@ class RoleTest extends TestCase
public function a_role_has_permissions() public function a_role_has_permissions()
{ {
$this->assertInstanceOf( $this->assertInstanceOf(
'Illuminate\Database\Eloquent\Collection', $this->adminRole->permissions 'Illuminate\Database\Eloquent\Collection',
$this->adminRole->permissions
); );
} }
} }
...@@ -10,7 +10,8 @@ class UserTest extends TestCase ...@@ -10,7 +10,8 @@ class UserTest extends TestCase
public function a_user_has_a_roles() public function a_user_has_a_roles()
{ {
$this->assertInstanceOf( $this->assertInstanceOf(
'Illuminate\Database\Eloquent\Collection', $this->admin->roles 'Illuminate\Database\Eloquent\Collection',
$this->admin->roles
); );
} }
...@@ -18,7 +19,8 @@ class UserTest extends TestCase ...@@ -18,7 +19,8 @@ class UserTest extends TestCase
public function a_user_has_a_permissions() public function a_user_has_a_permissions()
{ {
$this->assertInstanceOf( $this->assertInstanceOf(
'Illuminate\Database\Eloquent\Collection', $this->admin->permissions 'Illuminate\Database\Eloquent\Collection',
$this->admin->permissions
); );
} }
...@@ -26,7 +28,8 @@ class UserTest extends TestCase ...@@ -26,7 +28,8 @@ class UserTest extends TestCase
public function a_user_has_a_providers() public function a_user_has_a_providers()
{ {
$this->assertInstanceOf( $this->assertInstanceOf(
'Illuminate\Database\Eloquent\Collection', $this->admin->providers 'Illuminate\Database\Eloquent\Collection',
$this->admin->providers
); );
} }
...@@ -34,7 +37,8 @@ class UserTest extends TestCase ...@@ -34,7 +37,8 @@ class UserTest extends TestCase
public function a_user_has_a_sessions() public function a_user_has_a_sessions()
{ {
$this->assertInstanceOf( $this->assertInstanceOf(
'Illuminate\Database\Eloquent\Collection', $this->admin->sessions 'Illuminate\Database\Eloquent\Collection',
$this->admin->sessions
); );
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment