Skip to content

Commit

Permalink
Merge pull request #70 from dsbilling/shift-106142
Browse files Browse the repository at this point in the history
  • Loading branch information
dsbilling authored Dec 9, 2023
2 parents 4c3ce55 + 9dfe622 commit 7d5fcc9
Show file tree
Hide file tree
Showing 106 changed files with 1,648 additions and 1,804 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

Expand Down
5 changes: 1 addition & 4 deletions app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ class CreateNewUser implements CreatesNewUsers

/**
* Validate and create a newly registered user.
*
* @param array $input
* @return \App\Models\User
*/
public function create(array $input)
public function create(array $input): User
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
Expand Down
4 changes: 1 addition & 3 deletions app/Actions/Fortify/PasswordValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array
*/
protected function passwordRules()
protected function passwordRules(): array
{
return ['required', 'string', new Password, 'confirmed'];
}
Expand Down
4 changes: 1 addition & 3 deletions app/Actions/Fortify/ResetUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class ResetUserPassword implements ResetsUserPasswords
* Validate and reset the user's forgotten password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function reset($user, array $input)
public function reset($user, array $input): void
{
Validator::make($input, [
'password' => $this->passwordRules(),
Expand Down
4 changes: 1 addition & 3 deletions app/Actions/Fortify/UpdateUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class UpdateUserPassword implements UpdatesUserPasswords
* Validate and update the user's password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
public function update($user, array $input): void
{
Validator::make($input, [
'current_password' => ['required', 'string'],
Expand Down
8 changes: 2 additions & 6 deletions app/Actions/Fortify/UpdateUserProfileInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
* Validate and update the given user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
public function update($user, array $input): void
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
Expand All @@ -43,10 +41,8 @@ public function update($user, array $input)
* Update the given verified user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
protected function updateVerifiedUser($user, array $input)
protected function updateVerifiedUser($user, array $input): void
{
$user->forceFill([
'name' => $input['name'],
Expand Down
3 changes: 1 addition & 2 deletions app/Actions/Jetstream/DeleteUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ class DeleteUser implements DeletesUsers
* Delete the given user.
*
* @param mixed $user
* @return void
*/
public function delete($user)
public function delete($user): void
{
$user->deleteProfilePhoto();
$user->tokens->each->delete();
Expand Down
5 changes: 2 additions & 3 deletions app/Console/Commands/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ class Update extends Command

/**
* Execute the console command.
*
* @return int
*/
public function handle()
public function handle(): int
{
$this->info('Migrating...');
Artisan::call('migrate --force');
$this->info('Sync schedule monitor...');
$this->call('schedule-monitor:sync');

return Command::SUCCESS;
}
}
9 changes: 2 additions & 7 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule): void
{
// Often commands
$schedule->command(RunHealthChecksCommand::class)->everyMinute();
Expand All @@ -27,10 +24,8 @@ protected function schedule(Schedule $schedule)

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
protected function commands(): void
{
$this->load(__DIR__.'/Commands');

Expand Down
22 changes: 1 addition & 21 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@

class Handler extends ExceptionHandler
{
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [
//
];

/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<\Throwable>>
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed to the session on validation exceptions.
*
Expand All @@ -38,10 +20,8 @@ class Handler extends ExceptionHandler

/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
public function register(): void
{
$this->reportable(function (Throwable $e) {
if ($this->shouldReport($e) && app()->bound('sentry')) {
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

use App\Models\Post;
use Illuminate\Support\Str;
use Illuminate\View\View;

class BlogController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(): View
{
seo()->title('Blog - '.config('app.name'));
$posts = Post::where('published_at', '<=', now())->where('draft', false)->orderByDesc('published_at')->paginate(10);
Expand All @@ -24,9 +23,8 @@ public function index()
* Display the specified resource.
*
* @param \App\Models\Post $post
* @return \Illuminate\Http\Response
*/
public function show($param)
public function show($param): View
{
$post = Post::where('uuid', $param)
->where('draft', false)
Expand Down
36 changes: 9 additions & 27 deletions app/Http/Controllers/CertificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

use App\Models\Certification;
use App\Models\Company;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\View\View;
use Spatie\Tags\Tag;

class CertificationController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(): View
{
$certifications = Certification::orderBy('issued_at', 'desc')->paginate(10);

Expand All @@ -24,10 +24,8 @@ public function index()

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
public function create(): View
{
$companies = Company::pluck('name', 'id');
$tags = Tag::all();
Expand All @@ -37,11 +35,8 @@ public function create()

/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
public function store(Request $request): RedirectResponse
{
$validatedData = $request->validate([
'name' => [
Expand Down Expand Up @@ -89,22 +84,16 @@ public function store(Request $request)

/**
* Display the specified resource.
*
* @param \App\Models\Certification $certification
* @return \Illuminate\Http\Response
*/
public function show(Certification $certification)
public function show(Certification $certification): View
{
return view('certification.show', compact('certification'));
}

/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Certification $certification
* @return \Illuminate\Http\Response
*/
public function edit(Certification $certification)
public function edit(Certification $certification): View
{
$companies = Company::all();
$tags = Tag::all();
Expand All @@ -114,12 +103,8 @@ public function edit(Certification $certification)

/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Certification $certification
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Certification $certification)
public function update(Request $request, Certification $certification): RedirectResponse
{
$validatedData = $request->validate([
'name' => [
Expand Down Expand Up @@ -168,11 +153,8 @@ public function update(Request $request, Certification $certification)

/**
* Remove the specified resource from storage.
*
* @param \App\Models\Certification $certification
* @return \Illuminate\Http\Response
*/
public function destroy(Certification $certification)
public function destroy(Certification $certification): RedirectResponse
{
$certification->delete();
session()->flash('flash.banner', 'Deleted Certification!');
Expand Down
36 changes: 9 additions & 27 deletions app/Http/Controllers/CompanyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
namespace App\Http\Controllers;

use App\Models\Company;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;

class CompanyController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(): View
{
$companies = Company::orderBy('created_at', 'desc')->paginate(10);

Expand All @@ -21,21 +21,16 @@ public function index()

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
public function create(): View
{
return view('company.create');
}

/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
public function store(Request $request): RedirectResponse
{
$validatedData = $request->validate([
'name' => [
Expand All @@ -52,34 +47,24 @@ public function store(Request $request)

/**
* Display the specified resource.
*
* @param \App\Models\Company $company
* @return \Illuminate\Http\Response
*/
public function show(Company $company)
public function show(Company $company): View
{
return view('company.show', compact('company'));
}

/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Company $company
* @return \Illuminate\Http\Response
*/
public function edit(Company $company)
public function edit(Company $company): View
{
return view('company.edit', compact('company'));
}

/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Company $company
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Company $company)
public function update(Request $request, Company $company): RedirectResponse
{
$validatedData = $request->validate([
'name' => [
Expand All @@ -96,11 +81,8 @@ public function update(Request $request, Company $company)

/**
* Remove the specified resource from storage.
*
* @param \App\Models\Company $company
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, Company $company)
public function destroy(Request $request, Company $company): RedirectResponse
{
$company->delete();
session()->flash('flash.banner', 'Deleted Company!');
Expand Down
Loading

0 comments on commit 7d5fcc9

Please sign in to comment.