Skip to content

Commit 748140c

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/sentry/vite-plugin-0.5.1
2 parents b7a6e61 + a5ce9a9 commit 748140c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+459
-387
lines changed

.env.travis

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ LARAVEL_BLOCKER_BLADE_PLACEMENT_JS='footer_scripts'
120120
LARAVEL_BLOCKER_USE_TYPES_SEED_PUBLISHED=true
121121
LARAVEL_BLOCKER_USE_ITEMS_SEED_PUBLISHED=true
122122

123-
# Roles Default Models
124-
ROLES_DEFAULT_ROLE_MODEL=jeremykenedy\LaravelRoles\Models\Role
125-
ROLES_DEFAULT_PERMISSION_MODEL=jeremykenedy\LaravelRoles\Models\Permission
126-
127123
# Roles database information
128124
ROLES_DATABASE_CONNECTION=null
129125

.github/workflows/laravel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
1515
with:
16-
php-version: "8.0"
16+
php-version: "8.1"
1717
- uses: actions/checkout@v3
1818
- name: Copy .env
1919
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,6 @@ LARAVEL_BLOCKER_BLADE_PLACEMENT_JS='footer_scripts'
537537
LARAVEL_BLOCKER_USE_TYPES_SEED_PUBLISHED=true
538538
LARAVEL_BLOCKER_USE_ITEMS_SEED_PUBLISHED=true
539539
540-
# Roles Default Models
541-
ROLES_DEFAULT_ROLE_MODEL=jeremykenedy\LaravelRoles\Models\Role
542-
ROLES_DEFAULT_PERMISSION_MODEL=jeremykenedy\LaravelRoles\Models\Permission
543-
544540
# Roles database information
545541
ROLES_DATABASE_CONNECTION=null
546542

app/Exceptions/Handler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
use App\Mail\ExceptionOccured;
66
use Illuminate\Auth\AuthenticationException;
77
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
8-
use Illuminate\Http\Request;
9-
use Illuminate\Http\Response;
108
use Illuminate\Support\Facades\Log;
119
use Illuminate\Support\Facades\Mail;
12-
use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler;
1310
use Throwable;
1411

1512
class Handler extends ExceptionHandler
@@ -81,7 +78,7 @@ public function render($request, Throwable $e)
8178

8279
if ($userLevelCheck) {
8380
if ($request->expectsJson()) {
84-
return Response::json([
81+
return response()->json([
8582
'error' => 403,
8683
'message' => 'Unauthorized.',
8784
], 403);

app/Http/Controllers/Auth/ActivateController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Carbon\Carbon;
1313
use Illuminate\Support\Facades\Log;
1414
use Illuminate\Support\Facades\Route;
15-
use jeremykenedy\LaravelRoles\Models\Role;
15+
use App\Models\Role;
1616

1717
class ActivateController extends Controller
1818
{

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Illuminate\Foundation\Auth\RegistersUsers;
1212
use Illuminate\Support\Facades\Hash;
1313
use Illuminate\Support\Facades\Validator;
14-
use jeremykenedy\LaravelRoles\Models\Role;
14+
use App\Models\Role;
1515

1616
class RegisterController extends Controller
1717
{

app/Http/Controllers/Auth/SocialController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use App\Traits\CaptureIpTrait;
1111
use Illuminate\Http\Request;
1212
use Illuminate\Support\Facades\Config;
13-
use jeremykenedy\LaravelRoles\Models\Role;
13+
use App\Models\Role;
1414
use Laravel\Socialite\Facades\Socialite;
1515

1616
class SocialController extends Controller

app/Http/Controllers/SoftDeletesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use App\Models\User;
66
use Illuminate\Http\Request;
7-
use jeremykenedy\LaravelRoles\Models\Role;
7+
use App\Models\Role;
88

99
class SoftDeletesController extends Controller
1010
{

app/Http/Controllers/UsersManagementController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Illuminate\Http\Request;
1010
use Illuminate\Http\Response;
1111
use Illuminate\Support\Facades\Hash;
12-
use jeremykenedy\LaravelRoles\Models\Role;
12+
use App\Models\Role;
1313
use Validator;
1414

1515
class UsersManagementController extends Controller

app/Http/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Kernel extends HttpKernel
5555
*
5656
* @var array
5757
*/
58-
protected $routeMiddleware = [
58+
protected $middlewareAliases = [
5959
'auth' => \App\Http\Middleware\Authenticate::class,
6060
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
6161
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,

app/Http/Middleware/CheckCurrentUser.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
use Illuminate\Http\Request;
77
use Illuminate\Support\Facades\Auth;
88
use Illuminate\Support\Facades\Route;
9+
use Symfony\Component\HttpFoundation\Response;
910

1011
class CheckCurrentUser
1112
{
1213
/**
1314
* Handle an incoming request.
1415
*
15-
* @param \Illuminate\Http\Request $request
16-
* @param \Closure $next
17-
* @return mixed
16+
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
1817
*/
19-
public function handle($request, Closure $next)
18+
public function handle(Request $request, Closure $next): Response
2019
{
2120
if (! $request->user()) {
2221
abort(403, 'Unauthorized action.');

app/Http/Middleware/CheckIsUserActivated.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@
99
use Illuminate\Support\Facades\Auth;
1010
use Illuminate\Support\Facades\Log;
1111
use Illuminate\Support\Facades\Route;
12+
use Symfony\Component\HttpFoundation\Response;
1213

1314
class CheckIsUserActivated
1415
{
1516
/**
1617
* Handle an incoming request.
1718
*
18-
* @param \Illuminate\Http\Request $request
19-
* @param \Closure $next
20-
*
21-
* @return mixed
19+
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
2220
*/
23-
public function handle($request, Closure $next)
21+
public function handle(Request $request, Closure $next): Response
2422
{
2523
if (config('settings.activation')) {
2624
$user = Auth::user();

app/Models/Activation.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ class Activation extends Model
4040
'ip_address',
4141
];
4242

43-
/**
44-
* The attributes that should be mutated to dates.
45-
*
46-
* @var array
47-
*/
48-
protected $dates = [
49-
'created_at',
50-
'updated_at',
51-
];
52-
5343
/**
5444
* The attributes that are mass assignable.
5545
*
@@ -71,6 +61,8 @@ class Activation extends Model
7161
'user_id' => 'integer',
7262
'token' => 'string',
7363
'ip_address' => 'string',
64+
'created_at' => 'datetime',
65+
'updated_at' => 'datetime',
7466
];
7567

7668
/**

app/Models/Social.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ class Social extends Model
3636
*/
3737
protected $hidden = [];
3838

39-
/**
40-
* The attributes that should be mutated to dates.
41-
*
42-
* @var array
43-
*/
44-
protected $dates = [
45-
'created_at',
46-
'updated_at',
47-
];
48-
4939
/**
5040
* The attributes that are mass assignable.
5141
*
@@ -63,10 +53,12 @@ class Social extends Model
6353
* @var array
6454
*/
6555
protected $casts = [
66-
'id' => 'integer',
67-
'user_id' => 'integer',
68-
'provider' => 'string',
69-
'social_id' => 'string',
56+
'id' => 'integer',
57+
'user_id' => 'integer',
58+
'provider' => 'string',
59+
'social_id' => 'string',
60+
'created_at' => 'datetime',
61+
'updated_at' => 'datetime',
7062
];
7163

7264
/**

app/Models/Theme.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ class Theme extends Model
4040
*/
4141
protected $hidden = [];
4242

43-
/**
44-
* The attributes that should be mutated to dates.
45-
*
46-
* @var array
47-
*/
48-
protected $dates = [
49-
'created_at',
50-
'updated_at',
51-
'deleted_at',
52-
];
53-
5443
/**
5544
* Fillable fields for a Profile.
5645
*
@@ -79,6 +68,9 @@ class Theme extends Model
7968
'activated' => 'boolean',
8069
'taggable_id' => 'integer',
8170
'taggable_type' => 'string',
71+
'created_at' => 'datetime',
72+
'updated_at' => 'datetime',
73+
'deleted_at' => 'datetime',
8274
];
8375

8476
/**

app/Models/User.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@ class User extends Authenticatable
5050
'token',
5151
];
5252

53-
/**
54-
* The attributes that should be mutated to dates.
55-
*
56-
* @var array
57-
*/
58-
protected $dates = [
59-
'created_at',
60-
'updated_at',
61-
'deleted_at',
62-
];
63-
6453
/**
6554
* The attributes that are mass assignable.
6655
*
@@ -101,6 +90,9 @@ class User extends Authenticatable
10190
'admin_ip_address' => 'string',
10291
'updated_ip_address' => 'string',
10392
'deleted_ip_address' => 'string',
93+
'created_at' => 'datetime',
94+
'updated_at' => 'datetime',
95+
'deleted_at' => 'datetime',
10496
];
10597

10698
public function sendPasswordResetNotification($token)

app/Providers/AppServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public function register(): void
2222
*/
2323
public function boot(): void
2424
{
25-
URL::forceScheme('https');
25+
if ($this->app->environment('production')) {
26+
URL::forceScheme('https');
27+
}
2628
//Paginator::useBootstrapThree();
2729
Paginator::useBootstrap();
2830
Schema::defaultStringLength(191);

app/Providers/AuthServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ class AuthServiceProvider extends ServiceProvider
1313
* @var array<class-string, class-string>
1414
*/
1515
protected $policies = [
16-
'App\Models\Model' => 'App\Policies\ModelPolicy',
16+
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
1717
];
1818

1919
/**
2020
* Register any authentication / authorization services.
2121
*/
2222
public function boot(): void
2323
{
24-
$this->registerPolicies();
25-
2624
//
2725
}
2826
}

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
"predis/predis": "^2.1",
3636
"pusher/pusher-php-server": "^7.2",
3737
"rap2hpoutre/laravel-log-viewer": "^2.3",
38-
"socialiteproviders/37signals": "*",
39-
"socialiteproviders/instagram": "*",
40-
"socialiteproviders/linkedin": "*",
38+
"socialiteproviders/37signals": "^4.1",
39+
"socialiteproviders/instagram": "^5.0",
40+
"socialiteproviders/linkedin": "^4.2",
4141
"socialiteproviders/twitch": "^5.3",
42-
"socialiteproviders/youtube": "*"
42+
"socialiteproviders/youtube": "^4.1"
4343
},
4444
"require-dev": {
4545
"fakerphp/faker": "^1.9.1",

config/database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'charset' => 'utf8',
7575
'prefix' => '',
7676
'prefix_indexes' => true,
77-
'schema' => 'public',
77+
'search_path' => 'public',
7878
'sslmode' => 'prefer',
7979
],
8080

config/filesystems.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
|
1414
*/
1515

16-
'default' => env('FILESYSTEM_DRIVER', 'local'),
16+
'default' => env('FILESYSTEM_DISK', 'local'),
1717

1818
/*
1919
|--------------------------------------------------------------------------

database/seeders/ConnectRelationshipsSeeder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Database\Seeders;
44

5+
use App\Models\Permission;
6+
use App\Models\Role;
57
use Illuminate\Database\Seeder;
68

79
class ConnectRelationshipsSeeder extends Seeder
@@ -16,12 +18,12 @@ public function run(): void
1618
/**
1719
* Get Available Permissions.
1820
*/
19-
$permissions = config('roles.models.permission')::all();
21+
$permissions = Permission::all();
2022

2123
/**
2224
* Attach Permissions to Roles.
2325
*/
24-
$roleAdmin = config('roles.models.role')::where('name', '=', 'Admin')->first();
26+
$roleAdmin = Role::where('name', '=', 'Admin')->first();
2527
foreach ($permissions as $permission) {
2628
$roleAdmin->attachPermission($permission);
2729
}

database/seeders/PermissionsTableSeeder.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Database\Seeders;
44

5+
use App\Models\Permission;
56
use Illuminate\Database\Seeder;
67

78
class PermissionsTableSeeder extends Seeder
@@ -49,13 +50,13 @@ public function run(): void
4950
*
5051
*/
5152
foreach ($Permissionitems as $Permissionitem) {
52-
$newPermissionitem = config('roles.models.permission')::where('slug', '=', $Permissionitem['slug'])->first();
53-
if ($newPermissionitem === null) {
54-
$newPermissionitem = config('roles.models.permission')::create([
55-
'name' => $Permissionitem['name'],
56-
'slug' => $Permissionitem['slug'],
57-
'description' => $Permissionitem['description'],
58-
'model' => $Permissionitem['model'],
53+
$newPermissionitem = Permission::where('slug', '=', $Permissionitem['slug'])->first();
54+
if (null === $newPermissionitem) {
55+
$newPermissionitem = Permission::create([
56+
'name' => $Permissionitem['name'],
57+
'slug' => $Permissionitem['slug'],
58+
'description' => $Permissionitem['description'],
59+
'model' => $Permissionitem['model'],
5960
]);
6061
}
6162
}

0 commit comments

Comments
 (0)