Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Method LaravelZero\Framework\Application::originalFileName does not exist.#486

Answeredbyowenvoke
ousid asked this question inQ&A
Discussion options

Trying to usespatie/medialibrary-laravel inside laravel zero, and fetching images, from a url, but I get the following error:Method LaravelZero\Framework\Application::originalFileName does not exist.

Steps To Produce

  • install media library package
  • Fetch image url
  • Store the image into a collection (s3)
  • Run the command

Code Sample

collect($images)->each(function ($imageUrl)use ($productId) {$product = Product::find($productId);$product->addMediaFromUrl($imageUrl)     ->toMediaCollection('images','s3');});

Did anyone ran into a similar issue, and found a solution around?

Thanks in advance!

You must be logged in to vote

Have you addedSpatie\MediaLibrary\MediaLibraryServiceProvider::class to your service providers inconfig/app.php? 🤔

My guess is that the config hasn't been loaded because the service provider isn't loaded, and that means thatmedia-library.file_namer isnull, sothis line is probably just resolvingapp() as the actual application.

Replies: 1 comment 3 replies

Comment options

Have you addedSpatie\MediaLibrary\MediaLibraryServiceProvider::class to your service providers inconfig/app.php? 🤔

My guess is that the config hasn't been loaded because the service provider isn't loaded, and that means thatmedia-library.file_namer isnull, sothis line is probably just resolvingapp() as the actual application.

You must be logged in to vote
3 replies
@ousid
Comment options

You're totally right, I forgot about adding the service provider, in theconfig/app.php, since I'm a Laravel guy, I thought there's anauto discovery in Laravel zero 😆

Thank you for the help,@owenvoke!

@owenvoke
Comment options

Yeah, unfortunately not. 😬 I have wanted to add auto-discovery, however there were some issues I remember.

@ousid
Comment options

I see! Thanks for all the hard work, and for this awesome project@owenvoke!

Answer selected byousid
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@ousid@owenvoke

[8]ページ先頭

©2009-2025 Movatter.jp