Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e848124

Browse files
committed
Add PHP 8.2 and 8.3 support
1 parent 38ea884 commit e848124

File tree

5 files changed

+31
-25
lines changed

5 files changed

+31
-25
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes --config=fixer/.php_cs"
99
},
1010
"require": {
11-
"php": "^7.4|^8.0",
11+
"php": "^7.4|^8.0|^8.1|^8.2|^8.3",
1212
"litstack/lang": "^3.0.4",
1313
"erusev/parsedown-extra": "^0.8",
1414
"spatie/laravel-permission": "^2.0|^3.0|^4.0|^5.0",
1515
"astrotomic/laravel-translatable": "^11.0",
16-
"cviebrock/eloquent-sluggable": "^7.0|^8.0|^9.0",
16+
"cviebrock/eloquent-sluggable": "^7.0|^8.0|^9.0|^10.0",
1717
"spatie/laravel-medialibrary": "^8.0|^9.0|^10.0",
1818
"livewire/livewire": "^1.0|^2.0",
1919
"friendsofphp/php-cs-fixer": "^2.0|^3.0"

publish/database/migrations/______________________make_permissions.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ class MakePermissions extends Migration
6262
protected function buildPermissions()
6363
{
6464
$this->combineOperationsAndGroups(
65-
['read', 'update'], $this->editPermissionGroups
65+
['read', 'update'],
66+
$this->editPermissionGroups
6667
);
6768
$this->combineOperationsAndGroups(
68-
['create', 'read', 'update', 'delete'], $this->crudPermissionGroups
69+
['create', 'read', 'update', 'delete'],
70+
$this->crudPermissionGroups
6971
);
7072
}
7173

@@ -90,7 +92,8 @@ public function up()
9092
public function down()
9193
{
9294
$this->combineOperationsAndGroups(
93-
['create', 'read', 'update', 'delete'], $this->down
95+
['create', 'read', 'update', 'delete'],
96+
$this->down
9497
);
9598
$this->downPermissions();
9699
}

resources/views/info.blade.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
<div class="card-body">
44
<table>
55
<tr>
6-
<td><strong>PHP-Version:</strong></td><td> {{phpversion()}}</td>
6+
<td><strong>PHP-Version:</strong></td>
7+
<td> {{ phpversion() }}</td>
78
</tr>
8-
<tr>
9+
{{-- <tr>
910
<td><strong>SERVER_ADDR:</strong></td><td> {{ $_SERVER['SERVER_ADDR'] }}</td>
10-
</tr>
11+
</tr> --}}
1112
<tr>
12-
<td><strong>HTTP_HOST:</strong> </td><td>{{ $_SERVER['HTTP_HOST'] }}</td>
13+
<td><strong>HTTP_HOST:</strong> </td>
14+
<td>{{ $_SERVER['HTTP_HOST'] }}</td>
1315
</tr>
1416
<tr>
15-
<td><strong>SERVER_SOFTWARE:</strong></td><td> {{ $_SERVER['SERVER_SOFTWARE'] }}</td>
17+
<td><strong>SERVER_SOFTWARE:</strong></td>
18+
<td> {{ $_SERVER['SERVER_SOFTWARE'] }}</td>
1619
</tr>
1720
</table>
1821
</div>
1922
</div>
20-
</div>
23+
</div>

src/Foundation/Console/Concerns/InstallsVendorConfigs.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Support\Collection;
66
use Illuminate\Support\Str;
7+
use Spatie\Permission\PermissionServiceProvider;
78

89
trait InstallsVendorConfigs
910
{
@@ -80,12 +81,12 @@ protected function vendorMediaLibrary($migrationFiles)
8081
if (! $mediaMatch && $this->migrations()) {
8182
$this->callSilent('vendor:publish', [
8283
'--provider' => "Spatie\MediaLibrary\MediaLibraryServiceProvider",
83-
'--tag' => 'migrations',
84+
'--tag' => 'migrations',
8485
]);
8586
}
8687
$this->callSilent('vendor:publish', [
8788
'--provider' => "Spatie\MediaLibrary\MediaLibraryServiceProvider",
88-
'--tag' => 'config',
89+
'--tag' => 'config',
8990
]);
9091
$content = file_get_contents(config_path(medialibrary_config_key().'.php'));
9192
$content = str_replace(
@@ -108,8 +109,8 @@ protected function vendorPermissions()
108109
}
109110

110111
$this->callSilent('vendor:publish', [
111-
'--provider' => \Spatie\Permission\PermissionServiceProvider::class,
112-
'--tag' => 'migrations',
112+
'--provider' => PermissionServiceProvider::class,
113+
// '--tag' => 'migrations',
113114
]);
114115

115116
$migrationsPath = app()->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR;
@@ -122,6 +123,7 @@ protected function vendorPermissions()
122123
if ($name == basename($migration)) {
123124
return;
124125
}
126+
125127
$this->files->move($migration, $migrationsPath.$name);
126128
}
127129
}

src/Foundation/Console/InstallCommand.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class InstallCommand extends Command
3939
/**
4040
* Create new InstallCommand instance.
4141
*
42-
* @param Filesystem $files
4342
* @return void
4443
*/
4544
public function __construct(Filesystem $files)
@@ -108,16 +107,16 @@ protected function defaultUser()
108107
}
109108

110109
DB::table('lit_users')->insert([
111-
'username' => 'admin',
112-
'email' => '[email protected]',
110+
'username' => 'admin',
111+
'email' => '[email protected]',
113112
'first_name' => 'admin',
114-
'last_name' => '',
115-
'password' => bcrypt('secret'),
113+
'last_name' => '',
114+
'password' => bcrypt('secret'),
116115
]);
117116
DB::table(config('permission.table_names.model_has_roles'))->insert([
118-
'role_id' => Role::where('name', 'admin')->where('guard_name', 'lit')->first()->id,
117+
'role_id' => Role::where('name', 'admin')->where('guard_name', 'lit')->first()->id,
119118
'model_type' => 'Lit\\Models\\User',
120-
'model_id' => DB::table('lit_users')->where('email', '[email protected]')->first()->id,
119+
'model_id' => DB::table('lit_users')->where('email', '[email protected]')->first()->id,
121120
]);
122121

123122
$this->info('created default admin (email: [email protected], password: secret)');
@@ -126,7 +125,6 @@ protected function defaultUser()
126125
/**
127126
* Make directory if not exists.
128127
*
129-
* @param string $path
130128
* @return void
131129
*/
132130
private function makeDirectory(string $path)
@@ -156,13 +154,13 @@ private function handleLitPublishable()
156154
if ($this->migrations()) {
157155
$this->callSilent('vendor:publish', [
158156
'--provider' => LitstackServiceProvider::class,
159-
'--tag' => 'migrations',
157+
'--tag' => 'migrations',
160158
]);
161159
}
162160

163161
$this->callSilent('vendor:publish', [
164162
'--provider' => LitstackServiceProvider::class,
165-
'--tag' => 'config',
163+
'--tag' => 'config',
166164
]);
167165

168166
// Migrate tables.

0 commit comments

Comments
 (0)