Topherllobrera
Topherllobrera
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
and call the hint ->hintcolor('primary')->hint(fn ($state, $get) => ActivityHelper::activityChanges('children_record', $get, $state))
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
this is what I did
class ActivityHelper { public static function activityChanges($attribute, $get, $state) { $currentValue = $get($attribute); $personalInfoId = $get('id'); $status = $get('status'); if (!$personalInfoId) { return null; } if ($status === 'Approved') { // Delete activity log for this ID Activity::where('subject_type', 'App\Models\PersonalInformation') ->where('subject_id', $personalInfoId) ->delete(); return null; } $latestActivity = Activity::query() ->where('subject_type', 'App\Models\PersonalInformation') ->where('subject_id', $personalInfoId) // Specific to this personal info record ->where('event', 'updated') ->whereJsonContains("properties->attributes->$attribute", $currentValue) ->whereRaw("JSON_EXTRACT(properties, '$.attributes.$attribute') != JSON_EXTRACT(properties, '$.old.$attribute')") ->latest() ->first(); return $latestActivity ? 'Updated' : null; } }`
21 replies
FFilament
Created by Douglas Gough on 10/15/2024 in #❓┊help
ImportAction bypass FileUpload and pass filename directly
You can just route it
4 replies
FFilament
Created by Mehmet K. on 10/15/2024 in #❓┊help
How can I save data in custom modal?
Is it fillable in your model?
7 replies
FFilament
Created by BKF Dev on 10/15/2024 in #❓┊help
Call Resource Save Changes Button
Did you fix it?
5 replies
FFilament
Created by . on 10/13/2024 in #❓┊help
Issue with FileUpload Component Not Loading in Laravel Filament
this is the official response of @Dan Harrin https://filamentphp.com/content/danharrin-file-previews-not-loading
11 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
I think I can use spatie activity logs. I will reply and update you regarding the result
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
there is also status condition whenever the status is approve it will go back to normal state, removing the hint. The goal is to let the other user view the changes faster. My user is lazy.
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
Alright, the other solution I think is adding another column in database comparing the updated data. The downside is the speed of the app.
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
The goal is the other user can see any changes!
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
No description
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
@Dennis Koch hope you can help
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
Coolman understand it very well!
21 replies
FFilament
Created by Topherllobrera on 9/28/2024 in #❓┊help
Using hint that the record is edited.
TextInput::make('first_name') ->label('First Name') ->hintcolor('primary') ->hint(fn($record) => $record && $record->wasChanged('first_name') ? 'Updated' : '') ->placeholder('First Name') ->validationMessages(['required' => 'First name is required']) ->required(), TextInput::make('middle_name') ->label('Middle Name') ->placeholder('Middle Name') ->hintcolor('primary') ->hint(fn($record) => $record && $record->wasChanged('middle_name') ? 'Updated' : ''), TextInput::make('last_name') ->label('Last Name') ->placeholder('Last Name') ->required() ->hintcolor('primary') ->validationMessages(['required' => 'Last name is required']),
21 replies
FFilament
Created by nuovo2023 on 9/27/2024 in #❓┊help
Custom Action successRedirectUrl
12 replies
FFilament
Created by nuovo2023 on 9/27/2024 in #❓┊help
Custom Action successRedirectUrl
here is the saved when successfull use Filament\Notifications\Notification; protected function getSavedNotification(): ?Notification { return Notification::make() ->success() ->title('User updated') ->body('The user has been saved successfully.'); }
12 replies
FFilament
Created by nuovo2023 on 9/27/2024 in #❓┊help
Custom Action successRedirectUrl
here is the redirect code from the documentation protected function getRedirectUrl(): string { return $this->getResource()::getUrl('index'); }
12 replies
FFilament
Created by nuovo2023 on 9/27/2024 in #❓┊help
Custom Action successRedirectUrl
I think you can use Lifecycle hook https://filamentphp.com/docs/3.x/panels/resources/creating-records#lifecycle-hooks and do the thing you want to do
12 replies