Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pint styling #38

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Middleware/ActiveUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ActiveUser
{
public function handle(Request $request, Closure $next): mixed
{
//if user is not active log the user out
// if user is not active log the user out
if (! auth()->user()->is_active) {
flash('Your account has been deactivated. You cannot login.')->warning();
auth()->logout();
Expand Down
4 changes: 2 additions & 2 deletions app/Livewire/Admin/Roles/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function mount(): void

if (isset($this->role->permissions)) {
foreach ($this->role->permissions as $perm) {
//@phpstan-ignore-next-line
// @phpstan-ignore-next-line
$this->permissions[] = $perm->name;
}
}
Expand All @@ -74,7 +74,7 @@ public function update(): Redirector|RedirectResponse
{
$this->validate();

//@phpstan-ignore-next-line
// @phpstan-ignore-next-line
$this->role->label = $this->label;
$this->role->name = strtolower(str_replace(' ', '_', $this->label));

Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Admin/Users/Edit/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function update(): void
});
$img->stream();

//@phpstan-ignore-next-line
// @phpstan-ignore-next-line
Storage::disk('public')->put('users/'.$name, $img);

$this->user->image = 'users/'.$name;
Expand Down
10 changes: 5 additions & 5 deletions app/Livewire/Admin/Users/Edit/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ public function update(): bool
$role = Role::where('name', 'admin')
->firstOrFail();

//if admin role is not in array
// if admin role is not in array
if (! in_array(needle: $role->id, haystack: $this->roleSelections, strict: true)) {
$adminRolesCount = User::role('admin')->count();

//when there is only 1 admin role alert user and stop
// when there is only 1 admin role alert user and stop
if ($adminRolesCount === 1 && $this->user->hasRole('admin')) {
flash('there must be at least one admin user!')->error();

return false;
}

//@codeCoverageIgnoreStart
// @codeCoverageIgnoreStart
$this->syncRoles();

return false;
//@codeCoverageIgnoreEnd
// @codeCoverageIgnoreEnd
}

$this->syncRoles();
Expand All @@ -65,7 +65,7 @@ public function update(): bool

protected function syncRoles(): void
{
//@phpstan-ignore-next-line
// @phpstan-ignore-next-line
$rolesWithTenant = collect($this->roleSelections)->map(function (string $roleId) {
return [
'role_id' => $roleId,
Expand Down
4 changes: 2 additions & 2 deletions app/Livewire/Admin/Users/Invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public function store(): void
'invited_at' => now(),
]);

//generate image
// generate image
$name = get_initials($user->name);
$id = $user->id.'.png';
$path = 'users/';
$imagePath = create_avatar($name, $id, $path);

//save image
// save image
$user->image = $imagePath;
$user->save();

Expand Down
2 changes: 1 addition & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function boot(Request $request, UrlGenerator $url): void
view()->composer('components.layouts.app', function () {
if (auth()->check()) {
foreach (Setting::all() as $setting) {
//override config setting
// override config setting
config()->set([$setting->key => $setting->value]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions config/permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
/*
* Change this if you want to name the related pivots other than defaults
*/
'role_pivot_key' => null, //default 'role_id',
'permission_pivot_key' => null, //default 'permission_id',
'role_pivot_key' => null, // default 'role_id',
'permission_pivot_key' => null, // default 'permission_id',

/*
* Change this if you want to name the related model primary key other than
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use function Pest\Laravel\post;

test('login screen can be rendered', function () {
get(route('login'))->assertOk();
});
get(route('login'))->assertOk();
});

test('users can authenticate using the login screen', function () {
$user = User::factory()->create();
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/App/Http/Controllers/Auth/PasswordResetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use function Pest\Laravel\post;

test('reset password link screen can be rendered', function () {
get(route('password.request'))->assertOk();
});
get(route('password.request'))->assertOk();
});

test('reset password link can be requested', function () {
Notification::fake();
Expand All @@ -29,8 +29,8 @@
post(route('password.request'), ['email' => $user->email]);

Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
get('/reset-password/'.$notification->token)->assertOk();
get('/reset-password/'.$notification->token)->assertOk();

return true;
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use function Pest\Laravel\post;

test('can see register page', function () {
get(route('register'))->assertOk();
});
get(route('register'))->assertOk();
});

test('users cannot register with invalid password', function () {
post(route('register'), [
Expand Down Expand Up @@ -49,7 +49,7 @@
});

test('users can register', function () {
//Role::firstOrCreate(['name' => 'admin', 'label' => 'Admin']);
// Role::firstOrCreate(['name' => 'admin', 'label' => 'Admin']);
$password = 'ght73A3!$^DS';
$email = fake()->email();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
});

test('redirects when 2fa has already been verified', function () {
get(route('admin.2fa'))->assertRedirect(route('dashboard'));
});
get(route('admin.2fa'))->assertRedirect(route('dashboard'));
});

test('renders when 2fa has not been verified', function () {
session(['2fa-login' => true]);
Expand Down Expand Up @@ -65,8 +65,8 @@
});

test('can see 2fa setup page', function () {
get(route('admin.2fa-setup'))->assertOk();
});
get(route('admin.2fa-setup'))->assertOk();
});

test('code is required for update', function () {
post(route('admin.2fa-setup.update'), [])
Expand Down
12 changes: 6 additions & 6 deletions tests/Feature/App/Http/Controllers/WelcomeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
});

test('can see dashboard text on welcome page when logged in', function () {
get('/')->assertSeeText('Dashboard');
});
get('/')->assertSeeText('Dashboard');
});

});

describe('guest', function () {

test('can see login text on welcome page', function () {
get('/')
->assertSeeText('Login')
->assertSeeText('Register');
});
get('/')
->assertSeeText('Login')
->assertSeeText('Register');
});

});
6 changes: 3 additions & 3 deletions tests/Feature/App/Http/Middleware/AuthenticateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
use function Pest\Laravel\get;

test('returns 401 when not authenticated', function () {
get(route('dashboard'), ['Accept' => 'application/json'])
->assertUnauthorized();
});
get(route('dashboard'), ['Accept' => 'application/json'])
->assertUnauthorized();
});
4 changes: 2 additions & 2 deletions tests/Feature/App/Livewire/Admin/Users/Edit/ProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

test('can update profile', function () {

//fake image upload
// fake image upload
Storage::fake('public');
$image = UploadedFile::fake()->image('avatar.jpg');

Expand Down Expand Up @@ -70,7 +70,7 @@

test('image is deleted when a new image is uploaded', function () {

//fake image upload
// fake image upload
Storage::fake('public');

$user = auth()->user();
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected function setUp(): void

$this->withoutVite();

//$this->withoutExceptionHandling();
// $this->withoutExceptionHandling();
}

public function authenticate(string $role = 'admin', string $permissionName = ''): self
Expand Down