Roshan_k
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
getRedirectUrl
After creating a new Product i need to redirect from create page to another menu along with created data..
protected function getRedirectUrl(): string
{
return Url('app/kit-fee');
}
This code working but i need to send created data along with it..2 replies