talvbansal / media-manager

A simple file browser and up-loader for Laravel written in Vue.JS
MIT License
208 stars 44 forks source link

Unknown custom element <media-manager> #121

Closed iamraju closed 4 years ago

iamraju commented 4 years ago

Hi There,

I followed every steps but when I tried to use the custom element in my .vue view file, it throws the following error in the console:

[Vue warn]: Unknown custom element: <media-manager> - did you register the component correctly? For recursive components, make sure to provide the "name" option You have clearly written in the doc that it will automatically register the components, should I do anything to import the library ? I have this line added in app.js as well:

// Add this line...
require('./../vendor/talvbansal/media-manager/js/media-manager');

Environment: OS: Linux (Ubuntu) Laravel: 8.0 Vue: 2.6

Thanks in advance for looking into the issue.

talvbansal commented 4 years ago

Hi @iamraju,

Thanks for checking the project out!

So the project hasnt been updated in some time and as part of hacktoberfest im putting some time back into it.

I'm in the process of wrapping up a PR to make this work with bootstrap 4 and more recent versions of vue / laravel.

The change that needs to be done here is in this file:

https://github.com/talvbansal/media-manager/blob/master/resources/assets/js/media-manager.js

Where this part:

/**
 * Register Vue components...
 */
import MediaModal from "./components/MediaModal.vue";
import MediaManager from "./components/MediaManager.vue";

Vue.component("media-modal", MediaModal);
Vue.component("media-manager", MediaManager);

Should look more like this:

https://github.com/laravel/laravel/blob/5.8/resources/js/app.js

Hopefully in the next couple of days i'll have this change set done and tagged. However it will be for bootstrap 4. I'll happily take the above and an asset rebuild as a PR to the current project though!

iamraju commented 4 years ago

Hi @talvbansal

Okay, I will try and get back to you. Thanks for the reply.

talvbansal commented 4 years ago

@iamraju the BS4 version is out now!

iamraju commented 4 years ago

@iamraju the BS4 version is out now!

What do you mean by 'is out now' ? When I tried to update the package, it says nothing to update. composer update talvbansal/media-manager

Isn't that I am supposed to do to get the latest update ?

iamraju commented 4 years ago

Sorry, it worked after reinstalling the package, now throwing error in the router, I will check on that.

talvbansal commented 4 years ago

since its a set of breaking changes i released it as v3.0.0 so where you might have ^2.5 before it needs to be ^3.0.0

Edit : https://github.com/talvbansal/media-manager-laravel-example this repo has a fully working example of the media manager being integrated into a laravel project

iamraju commented 4 years ago

since its a set of breaking changes i released it as v3.0.0 so where you might have ^2.5 before it needs to be ^3.0.0

Yes now it is working looks like but showing error on routes for some reason. Shouldn't adding the following in web.php work ?

\TalvBansal\MediaManager\Routes\MediaRoutes::get();

Also where this path (base path for the media manager inside public path/folder is set ? /admin/browser/index?path=

The path parameter is empty but did not find a way to set it from configuration. Like I want to set it to /storage/media. Where can I set it from ?

talvbansal commented 4 years ago

if you clone down the example repo you can see how it all works. If youre still having issues you'll need to provide me with more information.

talvbansal commented 4 years ago

@iamraju if this has been resolved are we good to close this out?

iamraju commented 4 years ago

@iamraju if this has been resolved are we good to close this out?

Yes, it was resolved, thank you so much !