Skip to content

Commit bfdef0f

Browse files
authored
Minor fixes (#61)
* Add missing providers * Update AdminPanelProvider.php * Update default migrations * Install API * Rename migrations * Delete sanctum.php
1 parent db6addb commit bfdef0f

19 files changed

+132
-124
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@
1010

1111
class AppServiceProvider extends ServiceProvider
1212
{
13-
/**
14-
* Register any application services.
15-
*/
16-
public function register(): void
17-
{
18-
//
19-
}
20-
21-
/**
22-
* Bootstrap any application services.
23-
*/
2413
public function boot(): void
2514
{
2615
JsonResource::withoutWrapping();

app/Providers/AuthServiceProvider.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
class AuthServiceProvider extends ServiceProvider
1111
{
12-
/**
13-
* Bootstrap any application services.
14-
*/
1512
public function boot(): void
1613
{
1714
Gate::define('viewPulse', function (User $user) {

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Filament\Pages;
1010
use Filament\Panel;
1111
use Filament\PanelProvider;
12-
use Filament\Widgets;
1312
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
1413
use Illuminate\Cookie\Middleware\EncryptCookies;
1514
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
@@ -37,10 +36,6 @@ public function panel(Panel $panel): Panel
3736
])
3837
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
3938
->plugin(FilamentSpatieRolesPermissionsPlugin::make())
40-
->widgets([
41-
Widgets\AccountWidget::class,
42-
Widgets\FilamentInfoWidget::class,
43-
])
4439
->middleware([
4540
EncryptCookies::class,
4641
AddQueuedCookiesToResponse::class,

app/Providers/HorizonServiceProvider.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,10 @@
55
use App\Enums\Role;
66
use App\Models\User;
77
use Illuminate\Support\Facades\Gate;
8-
use Laravel\Horizon\Horizon;
98
use Laravel\Horizon\HorizonApplicationServiceProvider;
109

1110
class HorizonServiceProvider extends HorizonApplicationServiceProvider
1211
{
13-
/**
14-
* Bootstrap any application services.
15-
*/
16-
public function boot(): void
17-
{
18-
parent::boot();
19-
20-
// Horizon::routeSmsNotificationsTo('15556667777');
21-
// Horizon::routeMailNotificationsTo('example@example.com');
22-
// Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
23-
}
24-
25-
/**
26-
* Register the Horizon gate.
27-
*
28-
* This gate determines who can access Horizon in non-local environments.
29-
*/
3012
protected function gate(): void
3113
{
3214
Gate::define('viewHorizon', function (User $user) {

bootstrap/app.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
return Application::configure(basePath: dirname(__DIR__))
88
->withRouting(
99
web: __DIR__.'/../routes/web.php',
10+
api: __DIR__.'/../routes/api.php',
1011
commands: __DIR__.'/../routes/console.php',
1112
health: '/up',
1213
)

bootstrap/providers.php

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

33
return [
44
App\Providers\AppServiceProvider::class,
5+
App\Providers\AuthServiceProvider::class,
56
App\Providers\Filament\AdminPanelProvider::class,
7+
App\Providers\HorizonServiceProvider::class,
68
];

composer.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
'passwords' => [
9090
'users' => [
9191
'provider' => 'users',
92-
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_resets'),
92+
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
9393
'expire' => 60,
9494
'throttle' => 60,
9595
],

database/migrations/2014_10_12_000000_create_users_table.php renamed to database/migrations/0001_01_01_000000_create_users_table.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
{
1010
/**
1111
* Run the migrations.
12-
*
13-
* @return void
1412
*/
15-
public function up()
13+
public function up(): void
1614
{
1715
Schema::create('users', function (Blueprint $table) {
1816
$table->id();
@@ -25,15 +23,30 @@ public function up()
2523
$table->rememberToken();
2624
$table->timestamps();
2725
});
26+
27+
Schema::create('password_reset_tokens', function (Blueprint $table) {
28+
$table->string('email')->primary();
29+
$table->string('token');
30+
$table->timestamp('created_at')->nullable();
31+
});
32+
33+
Schema::create('sessions', function (Blueprint $table) {
34+
$table->string('id')->primary();
35+
$table->foreignId('user_id')->nullable()->index();
36+
$table->string('ip_address', 45)->nullable();
37+
$table->text('user_agent')->nullable();
38+
$table->longText('payload');
39+
$table->integer('last_activity')->index();
40+
});
2841
}
2942

3043
/**
3144
* Reverse the migrations.
32-
*
33-
* @return void
3445
*/
35-
public function down()
46+
public function down(): void
3647
{
3748
Schema::dropIfExists('users');
49+
Schema::dropIfExists('password_reset_tokens');
50+
Schema::dropIfExists('sessions');
3851
}
3952
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('cache', function (Blueprint $table) {
15+
$table->string('key')->primary();
16+
$table->mediumText('value');
17+
$table->integer('expiration');
18+
});
19+
20+
Schema::create('cache_locks', function (Blueprint $table) {
21+
$table->string('key')->primary();
22+
$table->string('owner');
23+
$table->integer('expiration');
24+
});
25+
}
26+
27+
/**
28+
* Reverse the migrations.
29+
*/
30+
public function down(): void
31+
{
32+
Schema::dropIfExists('cache');
33+
Schema::dropIfExists('cache_locks');
34+
}
35+
};

0 commit comments

Comments
 (0)