Skip to content

Commit d5f16b8

Browse files
authored
Merge pull request #28 from dcblogdev/v4
V4
2 parents 79600e4 + fbfb8af commit d5f16b8

File tree

94 files changed

+699
-383
lines changed

Some content is hidden

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

94 files changed

+699
-383
lines changed

stubs/app/Console/Commands/ClearLog.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
class ClearLog extends Command
88
{
99
protected $signature = 'log:clear';
10+
1011
protected $description = 'empty error log';
1112

1213
public function handle()
1314
{
1415
if (file_exists(storage_path('logs/laravel.log'))) {
15-
$f = fopen(storage_path('logs/laravel.log'), "r+");
16+
$f = fopen(storage_path('logs/laravel.log'), 'r+');
1617
if ($f !== false) {
1718
ftruncate($f, 0);
1819
fclose($f);

stubs/app/Console/Commands/MakeDatabaseCommand.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,18 @@
66

77
class MakeDatabaseCommand extends Command
88
{
9-
/**
10-
* The name and signature of the console command.
11-
*
12-
* @var string
13-
*/
149
protected $signature = 'db:build';
1510

16-
/**
17-
* The console command description.
18-
*
19-
* @var string
20-
*/
2111
protected $description = 'Build and seed all table from fresh.';
2212

23-
/**
24-
* Execute the console command.
25-
*
26-
* @return mixed
27-
*/
28-
public function handle()
13+
public function handle(): void
2914
{
30-
if (app()->environment(['local', 'staging'])) {
15+
if (in_array(config('app.env'), ['local', 'staging'])) {
3116
if ($this->confirm('Do you wish to continue?')) {
3217
$this->call('migrate:fresh');
3318
$this->line('------');
3419
$this->call('db:seed');
20+
$this->line('Completed!');
3521
}
3622
} else {
3723
$this->error('This command is disabled on production.');

stubs/app/Console/Kernel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel
1919
/**
2020
* Define the application's command schedule.
2121
*
22-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2322
* @return void
2423
*/
2524
protected function schedule(Schedule $schedule)

stubs/app/Exceptions/Handler.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6+
use Throwable;
7+
8+
class Handler extends ExceptionHandler
9+
{
10+
/**
11+
* The list of the inputs that are never flashed to the session on validation exceptions.
12+
*
13+
* @var array<int, string>
14+
*/
15+
protected $dontFlash = [
16+
'current_password',
17+
'password',
18+
'password_confirmation',
19+
];
20+
21+
/**
22+
* Register the exception handling callbacks for the application.
23+
*/
24+
public function register(): void
25+
{
26+
$this->reportable(function (Throwable $e) {
27+
//
28+
});
29+
}
30+
}

stubs/app/Http/Controllers/Auth/AuthenticatedSessionController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Http\Controllers\Auth;
46

57
use App\Http\Controllers\Controller;
@@ -28,6 +30,10 @@ public function store(LoginRequest $request): RedirectResponse
2830

2931
$request->session()->regenerate();
3032

33+
if ($request->user()->hasRole('user')) {
34+
return redirect(route('admin.users.index'));
35+
}
36+
3137
return redirect()->intended(route('dashboard'));
3238
}
3339

stubs/app/Http/Controllers/Auth/ConfirmablePasswordController.php

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

3+
declare(strict_types=1);
4+
35
namespace App\Http\Controllers\Auth;
46

57
use App\Http\Controllers\Controller;

stubs/app/Http/Controllers/Auth/EmailVerificationNotificationController.php

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

3+
declare(strict_types=1);
4+
35
namespace App\Http\Controllers\Auth;
46

57
use App\Http\Controllers\Controller;

stubs/app/Http/Controllers/Auth/EmailVerificationPromptController.php

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

3+
declare(strict_types=1);
4+
35
namespace App\Http\Controllers\Auth;
46

57
use App\Http\Controllers\Controller;

stubs/app/Http/Controllers/Auth/JoinController.php

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

55
namespace App\Http\Controllers\Auth;
66

7+
use App\Http\Controllers\Controller;
78
use App\Models\AuditTrail;
89
use App\Models\Setting;
910
use App\Models\User;
1011
use Illuminate\Contracts\View\View;
1112
use Illuminate\Http\RedirectResponse;
1213
use Illuminate\Http\Request;
13-
use Illuminate\Routing\Controller;
1414
use Illuminate\Routing\Redirector;
1515
use Illuminate\Support\Facades\Hash;
1616
use Illuminate\Validation\Rules\Password;

stubs/app/Http/Controllers/Auth/NewPasswordController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Http\Controllers\Auth;
46

57
use App\Http\Controllers\Controller;
@@ -56,6 +58,6 @@ function ($user) use ($request) {
5658
return $status == Password::PASSWORD_RESET
5759
? redirect()->route('login')->with('status', __($status))
5860
: back()->withInput($request->only('email'))
59-
->withErrors(['email' => __($status)]);
61+
->withErrors(['email' => __($status)]);
6062
}
6163
}

0 commit comments

Comments
 (0)