Closed captainspain closed 6 years ago
Hi @captainspain, thanks for your contribution. Can you give me more explanation for this? Regards
Hi @nauvalazhar, You are welcome, I like this package (simple and does what it says) :+1:
The reason for this PR: I was creating a very simple CMS, where I use this package for media upload. But I wanted to use different folders for different pages. In the normal setup you can only select one path, and now I can add as many paths I would like to. So if you don't specify the directory and directory_name it will use the default config as it was, like:
<script>
$("#midia-inline").midia({
inline: true,
base_url: '{{url('')}}'
});
</script>
This will use the directory, directory_name from midia config file (default). But if you specify the directory and directory_name it will use the custom paths:
<script>
$("#midia-inline").midia({
inline: true,
base_url: '{{url('')}}',
directory: '{{ config('midia.home_directory') }}',
directory_name: '{{ config('midia.home_directory_name') }}'
});
</script>
If you specify it like this it will add the GET params to the XHR request so the controller knows to use an other path. You can also add a custom path without adding it to your config, but I prefer it to do it in config.
Regards.
Whoa, nice work. I will merge your PR for a better library. Thanks for your contribution.
This way you could use custom directories.
Usage config/midia.php
In your view: