Skip to content

Commit

Permalink
Installation
Browse files Browse the repository at this point in the history
  • Loading branch information
kreaweb.be committed Apr 18, 2024
1 parent ba631a3 commit e29fef3
Show file tree
Hide file tree
Showing 114 changed files with 1,775 additions and 1,740 deletions.
26 changes: 13 additions & 13 deletions app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ public function create(array $input): User
{
Validator::make($input, [
'firstname' => ['nullable', 'string', 'max:255'],
'surname' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'language' => ['required', Rule::in(array_values(config('app.available_locales')))],
'timezone' => ['required', Rule::in(array_values(timezone_identifiers_list()))],
'password' => $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
'surname' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'language' => ['required', Rule::in(array_values(config('app.available_locales')))],
'timezone' => ['required', Rule::in(array_values(timezone_identifiers_list()))],
'password' => $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])->validate();

return DB::transaction(function () use ($input) {
return tap(User::create([
'firstname' => $input['firstname'] ?? null,
'surname' => $input['surname'],
'email' => $input['email'],
'language' => $input['language'],
'timezone' => $input['timezone'],
'password' => Hash::make($input['password']),
'surname' => $input['surname'],
'email' => $input['email'],
'language' => $input['language'],
'timezone' => $input['timezone'],
'password' => Hash::make($input['password']),
]), function (User $user) {
$this->createTeam($user);
});
Expand All @@ -52,8 +52,8 @@ public function create(array $input): User
protected function createTeam(User $user): void
{
$user->ownedTeams()->save(Team::forceCreate([
'user_id' => $user->id,
'name' => $user->name . "'s Team",
'user_id' => $user->id,
'name' => $user->name . "'s Team",
'personal_team' => true,
]));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Fortify/UpdateUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function update(User $user, array $input): void
{
Validator::make($input, [
'current_password' => ['required', 'string', 'current_password:web'],
'password' => $this->passwordRules(),
'password' => $this->passwordRules(),
], [
'current_password.current_password' => __('The provided password does not match your current password.'),
])->validateWithBag('updatePassword');
Expand Down
28 changes: 14 additions & 14 deletions app/Actions/Fortify/UpdateUserProfileInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public function update(User $user, array $input): void
{
Validator::make($input, [
'firstname' => ['nullable', 'string', 'max:255'],
'surname' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
'language' => ['required', Rule::in(array_values(config('app.available_locales')))],
'timezone' => ['required', Rule::in(array_values(timezone_identifiers_list()))],
'surname' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
'language' => ['required', Rule::in(array_values(config('app.available_locales')))],
'timezone' => ['required', Rule::in(array_values(timezone_identifiers_list()))],
])->validateWithBag('updateProfileInformation');

if (isset($input['photo'])) {
Expand All @@ -35,10 +35,10 @@ public function update(User $user, array $input): void
} else {
$user->forceFill([
'firstname' => $input['firstname'] ?? null,
'surname' => $input['surname'],
'email' => $input['email'],
'language' => $input['language'],
'timezone' => $input['timezone'],
'surname' => $input['surname'],
'email' => $input['email'],
'language' => $input['language'],
'timezone' => $input['timezone'],
])->save();
}
}
Expand All @@ -51,12 +51,12 @@ public function update(User $user, array $input): void
protected function updateVerifiedUser(User $user, array $input): void
{
$user->forceFill([
'firstname' => $input['firstname'] ?? null,
'surname' => $input['surname'],
'email' => $input['email'],
'firstname' => $input['firstname'] ?? null,
'surname' => $input['surname'],
'email' => $input['email'],
'email_verified_at' => null,
'language' => $input['language'],
'timezone' => $input['timezone'],
'language' => $input['language'],
'timezone' => $input['timezone'],
])->save();

$user->sendEmailVerificationNotification();
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Jetstream/AddTeamMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function validate(Team $team, string $email, ?string $role): void
{
Validator::make([
'email' => $email,
'role' => $role,
'role' => $role,
], $this->rules(), [
'email.exists' => __('We were unable to find a registered user with this email address.'),
])->after(
Expand All @@ -59,7 +59,7 @@ protected function rules(): array
{
return array_filter([
'email' => ['required', 'email', 'exists:users'],
'role' => Jetstream::hasRoles() ? ['required', 'string', new Role] : null,
'role' => Jetstream::hasRoles() ? ['required', 'string', new Role] : null,
]);
}

Expand Down
6 changes: 3 additions & 3 deletions app/Actions/Jetstream/CreateTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public function create(User $user, array $input): Team
Gate::forUser($user)->authorize('create', Jetstream::newTeamModel());

Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'name' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string', 'max:255'],
])->validateWithBag('createTeam');

AddingTeam::dispatch($user);

$user->switchTeam($team = $user->ownedTeams()->create([
'name' => $input['name'],
'description' => $input['description'] ?? null,
'name' => $input['name'],
'description' => $input['description'] ?? null,
'personal_team' => false,
]));

Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Jetstream/InviteTeamMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function invite(User $user, Team $team, string $email, ?string $role = nu

$invitation = $team->teamInvitations()->create([
'email' => $email,
'role' => $role,
'role' => $role,
]);

Mail::to($email)->send(new TeamInvitation($invitation));
Expand All @@ -44,7 +44,7 @@ protected function validate(Team $team, string $email, ?string $role): void
{
Validator::make([
'email' => $email,
'role' => $role,
'role' => $role,
], $this->rules($team), [
'email.unique' => __('This user has already been invited to the team.'),
])->after(
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Jetstream/UpdateTeamName.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public function update(User $user, Team $team, array $input): void
Gate::forUser($user)->authorize('update', $team);

Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'name' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string', 'max:255'],
])->validateWithBag('updateTeamName');

$team->forceFill([
'name' => $input['name'],
'name' => $input['name'],
'description' => $input['description'] ?? null,
])->save();
}
Expand Down
16 changes: 8 additions & 8 deletions app/Http/Middleware/LogAllRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ public function handle(Request $request, Closure $next): Response

$headers = $request->header();

$dt = new Carbon();
$dt = new Carbon();
$data = [
'path' => $request->getPathInfo(),
'method' => $request->getMethod(),
'ip' => $request->ip(),
'path' => $request->getPathInfo(),
'method' => $request->getMethod(),
'ip' => $request->ip(),
'http_version' => $_SERVER['SERVER_PROTOCOL'] ?? null,
'timestamp' => $dt->toDateTimeString(),
'headers' => [
'timestamp' => $dt->toDateTimeString(),
'headers' => [
// get all the required headers to log
'user-agent' => $headers['user-agent'] ?? null,
'referer' => $headers['referer'] ?? null,
'origin' => $headers['origin'] ?? null,
'referer' => $headers['referer'] ?? null,
'origin' => $headers['origin'] ?? null,
],
];

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Users/UpdatePasswordRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function messages()
{
return [
'old_password.current_password' => trans('passwords.old_password'),
'new_password.same_password' => trans('passwords.same_password'),
'new_password.same_password' => trans('passwords.same_password'),
];
}
}
34 changes: 17 additions & 17 deletions app/Http/Requests/Users/UpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,32 @@ public function authorize()
public function rules()
{
return [
'nickname' => 'sometimes|required|string|max:255',
'surname' => 'sometimes|required|string|max:255',
'firstname' => 'sometimes|required|string|max:255',
'sex' => 'sometimes|required|string|min:1|max:1',
'dob' => 'nullable|date|date_format:Y-m-d',
'yob' => 'nullable|date_format:Y',
'dod' => 'nullable|date|date_format:Y-m-d',
'yod' => 'nullable|date_format:Y',
'phone' => 'nullable|string|max:255',
'address' => 'nullable|string|max:255',
'city' => 'nullable|string|max:255',
'email' => 'nullable|string|max:255',
'password' => 'nullable|min:8|max:15',
'nickname' => 'sometimes|required|string|max:255',
'surname' => 'sometimes|required|string|max:255',
'firstname' => 'sometimes|required|string|max:255',
'sex' => 'sometimes|required|string|min:1|max:1',
'dob' => 'nullable|date|date_format:Y-m-d',
'yob' => 'nullable|date_format:Y',
'dod' => 'nullable|date|date_format:Y-m-d',
'yod' => 'nullable|date_format:Y',
'phone' => 'nullable|string|max:255',
'address' => 'nullable|string|max:255',
'city' => 'nullable|string|max:255',
'email' => 'nullable|string|max:255',
'password' => 'nullable|min:8|max:15',
'birth_order' => 'nullable|numeric|min:1',

'cemetery_location_name' => 'nullable|string|max:255',
'cemetery_location_address' => 'nullable|string|max:255',
'cemetery_location_latitude' => 'required_with:cemetery_location_longitude|nullable|string|max:255',
'cemetery_location_name' => 'nullable|string|max:255',
'cemetery_location_address' => 'nullable|string|max:255',
'cemetery_location_latitude' => 'required_with:cemetery_location_longitude|nullable|string|max:255',
'cemetery_location_longitude' => 'required_with:cemetery_location_latitude|nullable|string|max:255',
];
}

public function messages()
{
return [
'password.current_password' => trans('passwords.old_password'),
'password.current_password' => trans('passwords.old_password'),
'new_password.same_password' => trans('passwords.same_password'),
];
}
Expand Down
10 changes: 5 additions & 5 deletions app/Livewire/Backups/Manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ public function mount(): void
{
$this->backups = collect();

$disk = Storage::disk(env('BACKUP_DISK', 'backups'));
$disk = Storage::disk(env('BACKUP_DISK', 'backups'));
$files = $disk->files(config('backup.backup.name'));

// make a collection of existing backup files, with their filesize and creation date
foreach ($files as $index => $file) {
// only take zip files into account
if (substr($file, -4) == '.zip' && $disk->exists($file)) {
$this->backups->push([
'file_name' => str_replace(config('backup.backup.name') . '/', '', $file),
'file_size' => $this->humanFilesize($disk->size($file)),
'file_name' => str_replace(config('backup.backup.name') . '/', '', $file),
'file_size' => $this->humanFilesize($disk->size($file)),
'date_created' => Carbon::createFromTimestamp($disk->lastModified($file))->format('d-m-Y H:i:s'),
'date_ago' => Carbon::createFromTimestamp($disk->lastModified($file))->diffForHumans(Carbon::now()),
'date_ago' => Carbon::createFromTimestamp($disk->lastModified($file))->diffForHumans(Carbon::now()),
]);
}
}
Expand Down Expand Up @@ -146,7 +146,7 @@ public function deleteBackup()

protected function humanFilesize(mixed $bytes, int $decimals = 2)
{
$sz = 'BKMGTP';
$sz = 'BKMGTP';
$factor = floor((strlen($bytes) - 1) / 3);

return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . ' ' . @$sz[$factor];
Expand Down
8 changes: 4 additions & 4 deletions app/Livewire/Forms/People/ChildForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function genders()
// -----------------------------------------------------------------------
protected $rules = [
'firstname' => ['required_without:person_id', 'nullable', 'string', 'max:255'],
'surname' => ['required_without:person_id', 'nullable', 'string', 'max:255'],
'sex' => ['required_without:person_id', 'nullable', 'in:m,f'],
'surname' => ['required_without:person_id', 'nullable', 'string', 'max:255'],
'sex' => ['required_without:person_id', 'nullable', 'in:m,f'],
'gender_id' => ['nullable', 'integer'],

'photo' => ['nullable', 'string', 'max:255'],
Expand All @@ -55,8 +55,8 @@ public function validationAttributes()
{
return [
'firstname' => __('person.firstname'),
'surname' => __('person.surname'),
'sex' => __('person.sex'),
'surname' => __('person.surname'),
'sex' => __('person.sex'),
'gender_id' => __('person.gender'),

'photo' => __('person.photo'),
Expand Down
28 changes: 14 additions & 14 deletions app/Livewire/Forms/People/ContactForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public function countries()

// -----------------------------------------------------------------------
protected $rules = [
'street' => ['nullable', 'string', 'max:100'],
'number' => ['nullable', 'string', 'max:20'],
'street' => ['nullable', 'string', 'max:100'],
'number' => ['nullable', 'string', 'max:20'],
'postal_code' => ['nullable', 'string', 'max:20'],
'city' => ['nullable', 'string', 'max:100'],
'province' => ['nullable', 'string', 'max:100'],
'state' => ['nullable', 'string', 'max:100'],
'country_id' => ['nullable', 'integer'],
'phone' => ['nullable', 'string', 'max:50'],
'city' => ['nullable', 'string', 'max:100'],
'province' => ['nullable', 'string', 'max:100'],
'state' => ['nullable', 'string', 'max:100'],
'country_id' => ['nullable', 'integer'],
'phone' => ['nullable', 'string', 'max:50'],
];

public function messages()
Expand All @@ -52,14 +52,14 @@ public function messages()
public function validationAttributes()
{
return [
'street' => __('person.street'),
'number' => __('person.number'),
'street' => __('person.street'),
'number' => __('person.number'),
'postal_code' => __('person.postal_code'),
'city' => __('person.city'),
'province' => __('person.province'),
'state' => __('person.state'),
'country_id' => __('person.country'),
'phone' => __('person.phone'),
'city' => __('person.city'),
'province' => __('person.province'),
'state' => __('person.state'),
'country_id' => __('person.country'),
'phone' => __('person.phone'),
];
}
}
20 changes: 10 additions & 10 deletions app/Livewire/Forms/People/DeathForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public function rules()
'before_or_equal:today',
new DodValid,
],
'pod' => ['nullable', 'string', 'max:255'],
'cemetery_location_name' => ['nullable', 'string', 'max:255'],
'cemetery_location_address' => ['nullable', 'string', 'max:255'],
'cemetery_location_latitude' => ['required_with:cemetery_location_longitude', 'nullable', 'numeric', 'decimal:0,13', 'min:-90', 'max:90'],
'pod' => ['nullable', 'string', 'max:255'],
'cemetery_location_name' => ['nullable', 'string', 'max:255'],
'cemetery_location_address' => ['nullable', 'string', 'max:255'],
'cemetery_location_latitude' => ['required_with:cemetery_location_longitude', 'nullable', 'numeric', 'decimal:0,13', 'min:-90', 'max:90'],
'cemetery_location_longitude' => ['required_with:cemetery_location_latitude', 'nullable', 'numeric', 'decimal:0,13', 'min:-180', 'max:180'],
];
}
Expand All @@ -61,12 +61,12 @@ public function messages()
public function validationAttributes()
{
return [
'yod' => __('person.yod'),
'dod' => __('person.dod'),
'pod' => __('person.pod'),
'cemetery_location_name' => __('metadata.location_name'),
'cemetery_location_address' => __('metadata.address'),
'cemetery_location_latitude' => __('metadata.latitude'),
'yod' => __('person.yod'),
'dod' => __('person.dod'),
'pod' => __('person.pod'),
'cemetery_location_name' => __('metadata.location_name'),
'cemetery_location_address' => __('metadata.address'),
'cemetery_location_latitude' => __('metadata.latitude'),
'cemetery_location_longitude' => __('metadata.longitude'),
];
}
Expand Down
Loading

0 comments on commit e29fef3

Please sign in to comment.