Skip to content
Open
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
4 changes: 3 additions & 1 deletion .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
run: |
composer update --lock
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/Gui/SquidUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

class SquidUserController extends Controller
{
private $squidUserService;

public function __construct(SquidUserService $squidUserService)
{
$this->squidUserService = $squidUserService;
public function __construct(
private readonly SquidUserService $squidUserService
) {
}

public function search(SearchRequest $request, SearchAction $action): View
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/Gui/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

class UserController extends Controller
{
private $user;

public function __construct(UserService $user)
{
$this->user = $user;
public function __construct(
private readonly UserService $user
) {
}

public function create(CreateRequest $request, CreateAction $action): RedirectResponse
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class User extends Authenticatable
'email_verified_at' => 'datetime',
];

public function setPasswordAttribute($value)
public function setPasswordAttribute(string $value): void
{
$this->attributes['password'] = Hash::needsRehash($value) ? Hash::make($value) : $value;
}
Expand Down
6 changes: 2 additions & 4 deletions app/Services/SquidAllowedIpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

class SquidAllowedIpService
{
public function getById($id) : SquidAllowedIp
public function getById(int|string $id): SquidAllowedIp
{
$ip = SquidAllowedIp::query()->where('id', '=', $id)->first();

return $ip ?? new SquidAllowedIp();
return SquidAllowedIp::query()->findOr($id, fn() => new SquidAllowedIp());
}
}
6 changes: 2 additions & 4 deletions app/Services/SquidUserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

class SquidUserService
{
public function getById($id) : SquidUser
public function getById(int|string $id): SquidUser
{
$su = SquidUser::query()->where('id', '=', $id)->first();

return $su ?? new SquidUser();
return SquidUser::query()->findOr($id, fn() => new SquidUser());
}
}
6 changes: 2 additions & 4 deletions app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

class UserService
{
public function getById($id) : User
public function getById(int|string $id): User
{
$user = User::query()->where('id', '=', $id)->first();

return $user ?? new User();
return User::query()->findOr($id, fn() => new User());
}
}
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
"license": "MIT",
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.4",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2"
"guzzlehttp/guzzle": "^7.9",
"laravel/framework": "^10.48",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.10",
"laravel/ui": "^4.5"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^2.4",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^2.0"
"fakerphp/faker": "^1.23",
"laravel/sail": "^1.38",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^7.10",
"nunomaduro/larastan": "^2.9",
"phpunit/phpunit": "^10.5",
"spatie/laravel-ignition": "^2.8"
},
"autoload": {
"psr-4": {
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"production": "mix --production"
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"axios": "^0.25",
"bootstrap": "^5.1.3",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"sass": "^1.32.11",
"sass-loader": "^11.0.1"
"@popperjs/core": "^2.11.8",
"axios": "^1.7.9",
"bootstrap": "^5.3.3",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.21",
"postcss": "^8.4.49",
"sass": "^1.83.4",
"sass-loader": "^16.0.4"
}
}
Loading