Get full path of FileUpload

I've defined a file upload field for uploading PDF to a model, as:
Forms\Components\FileUpload::make('pdf')
->acceptedFileTypes(['application/pdf'])
->visibleOn('create'),
Forms\Components\FileUpload::make('pdf')
->acceptedFileTypes(['application/pdf'])
->visibleOn('create'),
Now, I want to access this file after the model is created using model::boot method as below:
public static function boot()
{
parent::boot();
static::created(function ($model) {
$pdf = new Pdf($model->pdf);
//...
}
}
public static function boot()
{
parent::boot();
static::created(function ($model) {
$pdf = new Pdf($model->pdf);
//...
}
}
However, I get error as: File '01J085D4C9VX4Q2WSPFMTH95K8.pdf' does not exist. How do I obtain the full path of this PDF file?
1 Reply
Vp
Vp4w ago
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.