-2

I have enabled the fileinfo extension in PHP configuration on cPanel, but this error did not go away when using the Storage::url function in Laravel.

use Illuminate\Support\Facades\Storage;

class Verse extends Model
{
    use HasFactory;

    protected $fillable = [
        "chapter_id",
        "title",
        "text",
        "video_path",

    ];

    protected $appends = [
        "video_path_url",
    ];

    public function chapter()
    {
        return $this->belongsTo(Chapter::class)->with("book:id,name,osis,type,slug");
    }

    public function getVideoPathUrlAttribute()
    {
        return Storage::disk("public")->url($this->video_path);
    }
}

How do I fix this issue?

miken32
  • 42,008
  • 16
  • 111
  • 154
Leslie Joe
  • 281
  • 4
  • 17
  • https://stackoverflow.com/questions/32811014/file-info-php-error-class-finfo-not-found-but-the-module-is-in-php-ini – miken32 Jun 26 '23 at 16:22

1 Answers1

1

Simply go to "Select PHP Version" in your cPanel, then to "Extensions", look for "fileinfo", and lastly enable this function, and this should fix your problem, as it did mine.