Roshan_k
Custom Pages
public static function getPages(): array
{
return [
'index' => Pages\ListEvents::route('/'),
'create' => Pages\CreateEvent::route('/create'),
'edit' => Pages\EditEvent::route('/{record}/edit'),
'register' => Pages\Registration::route('/2/register'),
];
}
here 'register' => Pages\Registration::route('/2/register'),
instead of 2 i need to pass record how to pass it..3 replies
filters
Iam using SelectFilter in resource, while selecting item in a filter the table data not filtering, only when i reload the page that time only filtering, why like this? and my code will be like
->filters([
SelectFilter::make('day_id')
->label('Day')
->options(fn () => WeekDay::whereNot('id', config('constants.weekend_day.sunday'))->get()->pluck('name', 'id')->toArray())
->query(function (Builder $query, array $data) {
if (!empty($data['value'])) {
$query->where('day_id', $data['value']);
}
}),
])
6 replies
FileUpload
After Uploading a image using Fileupload the preview of image not loading , iam getting an error..This is my code
FileUpload::make('details.image')->preserveFilenames()->enableOpen()
->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
$timestamp = Carbon::now()->timestamp;
return (string) str($file->getClientOriginalName())->prepend($timestamp.'_');
})
->image()->directory('incident-images')->enableDownload()->label('Image Upload'),
this is .env APP_URL=http://localhost
, this is my filesystem 'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
, please anyone help me to solve this error4 replies
Custom page
After creating data using reource need to redirect to a custom page with created record id, how to get that id through route..
in getgaes of resource i added like this
public static function getPages(): array
{
return [
'details' => Pages\VehicleDetails::route('/details'),
];
}
,
in createpage i added
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('details');
}
4 replies
Redirects
I want to Redirect from a page to another page,..page is get redirecting i need to send data with it..
Action::make('pay_fees')
->action(function (array $data, $record): void {
Redirect::to('app/student-reg-fee-reciept')->with(['student' => $record]);
})
the data in another page showing null
public function mount(Request $request)
{
dd($request->get('student'));
$this->record = Student::query()->find($request->get('student'));
}
...how to get data in mount5 replies