Skip to content

Commit

Permalink
refactor: increase to 75 to allows bilangual fields but hopefully sta…
Browse files Browse the repository at this point in the history
…y within display limits of ORCID systems.
  • Loading branch information
vincentauger committed Dec 3, 2024
1 parent 5126b79 commit 4c9e4c6
Show file tree
Hide file tree
Showing 7 changed files with 4,670 additions and 4,654 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/AuthorEmploymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function store(Author $author, Request $request)

$validated = $request->validate([
'organization_id' => 'nullable|exists:organizations,id',
'role_title' => 'nullable|string|max:50',
'department_name' => 'nullable|string|max:50',
'role_title' => 'nullable|string|max:75',
'department_name' => 'nullable|string|max:75',
'start_date' => 'required|date',
'end_date' => 'nullable|date',
]);
Expand Down Expand Up @@ -81,8 +81,8 @@ public function update(Author $author, Request $request, AuthorEmployment $autho
$this->authorize('update', $authorEmployment);

$validated = $request->validate([
'role_title' => 'nullable|string|max:50',
'department_name' => 'nullable|string|max:50',
'role_title' => 'nullable|string|max:75',
'department_name' => 'nullable|string|max:75',
'start_date' => 'required|date',
'end_date' => 'nullable|date',
]);
Expand Down
45 changes: 30 additions & 15 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;
use Spatie\Health\Checks\Checks\CacheCheck;
use Spatie\Health\Checks\Checks\DatabaseCheck;
Expand Down Expand Up @@ -37,12 +38,10 @@ public function register()
*/
public function boot()
{
// prevent lazy loading
Model::preventLazyLoading(! App::isProduction());
Model::preventSilentlyDiscardingAttributes();
Model::preventAccessingMissingAttributes();

$this->configureCommands();
$this->configureVite();
$this->configureModel();
$this->configureHealth();

// https://spatie.be/docs/laravel-permission/v5/prerequisites#content-schema-limitation-in-mysql
Schema::defaultStringLength(125);
Expand All @@ -52,16 +51,6 @@ public function boot()
return $user->can(UserPermission::VIEW_PULSE);
});

// Add Spatie Health Checks
Health::checks([
UsedDiskSpaceCheck::new()->warnWhenUsedSpaceIsAbovePercentage(60)->failWhenUsedSpaceIsAbovePercentage(80),
DatabaseCheck::new(),
CacheCheck::new(),
DebugModeCheck::new(),
HorizonCheck::new(),
PingCheck::new()->url('https://api.orcid.org/')->timeout(2)->name('Orcid Api'),
RedisCheck::new(),
]);
}

/**
Expand All @@ -73,4 +62,30 @@ private function configureCommands(): void
App::isProduction()
);
}

private function configureVite(): void
{
Vite::useAggressivePrefetching();
}


private function configureModel(): void
{
Model::preventLazyLoading(! App::isProduction());
Model::preventSilentlyDiscardingAttributes();
Model::preventAccessingMissingAttributes();
}

private function configureHealth(): void
{
Health::checks([
UsedDiskSpaceCheck::new()->warnWhenUsedSpaceIsAbovePercentage(60)->failWhenUsedSpaceIsAbovePercentage(80),
DatabaseCheck::new(),
CacheCheck::new(),
DebugModeCheck::new(),
HorizonCheck::new(),
PingCheck::new()->url('https://api.orcid.org/')->timeout(2)->name('Orcid Api'),
RedisCheck::new(),
]);
}
}
Loading

0 comments on commit 4c9e4c6

Please sign in to comment.