-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Planning for Next Major Version #52
Comments
A few ideas that I had lingering:
|
Could you please integrate pagination of Media::inDirectory() and $object->getMedia('resources') etc, results |
Hi @robbielove, all of the Media::inDirectory('disk', 'dir')->paginate(); On the other hand, once you get to If you have a huge number of media attached to one model, you can use the MyModel::where(...)->with(['media' => function($q) {
$q->where('tag', 'resources')->paginate();
})->first(); Hope this helps. |
Hi @frasmage, it's good to see this package going forward! While I don't have any specific idea in mind, I'd love to contribute in the code or the tests when the time comes. I'll try to throw some ideas if something comes to mind! |
Thanks @sebdesign, I will let you know. I will admit that I got a bit distracted finishing up my other package for release, I should get started on this in the next week or two. |
It would be cool to be able to add custom properties to media(s), like rendering properties or if an image is protected from unathorized users,.... |
@kaju74 Ha! It just so happens that I have another package for exactly that type of thing plank/laravel-metable. Not something that I would integrate into the core, but trivially easy enough for a user to marry the two packages. Create a subclass of Cheers! |
Hi @frasmage , I have an idea for the next version: setting the file visibility per media. This could be set in the Cheers! |
Hey @sebdesign, Neat! I think that could easily be implemented, with three parts:
Is it worthwhile to record this value in the database? That would allow verifying the visibility with a query scope. However it records the information in two places, so they could fall out sync (granted that already happens if the file on disk is modified in any other way). In other news, I am leaning back in the direction of making the SourceAdapters return either stream resources or psr7 Streams across the board for 3.0. Ran into some memory limit issues with loading larger files into memory, which I imagine wouldn't be an issue for streams. PS: I know there hasn't been much movement on this from me in the past few months. This is due to some exciting yet time consuming developments in my personal life. Everything should be settled by early April. Hoping to get back to this project as soon as I can. Feel free to work on some PRs in the mean time! |
Hey @frasmage, First of all this is awesome package. Only one thing if available it would great.
Thanks for making great package. |
Hi @klaravel,
$media = $post->getMedia('gallery');
$post->syncMedia($media->reverse()->modelKeys()); (you shouldn't need to unpack the collection, just giving an example of passing an array of ids) |
Great. I will try this one. Example: I would like to use some API or other code to optimize that image same time upload image. I know that I can do it after upload image with it's location. |
This question has been asked a couple of times:
I am hoping to add built in support for imagine/intervention image at some point in the future to simplify things. If you have any other general questions, would you mind creating a separate thread so we don't clutter the next version discussion? |
Slowly making progress on this. Additional features that I am currently working on:
I'll push my 3.0 branch once I am satisfied with these features. |
Adding meta data to files? Similar to https://docs.spatie.be/laravel-medialibrary/v5/advanced-usage/adding-custom-properties |
Scratch that, saw your earlier comment regarding the same thing - would be cool to have it integrated :) |
Hi @liran-co, Indeed. Given that both of these are intended to be small modular components, I'm not keen on forcing the user to download both, when not everyone necessarily needs both. What might be a good solution is to add a section on how to integrate them yourself to the documentation. |
That would certainly work! Anyway to return the last ordered item? ->first() returns first, what about last()? |
I'm with @sebdesign on the public / private feature, it would be super helpful. I'm trying to upload some items as public and others as private. |
It would be nice if there was an easy way to create temporary urls. I know this feature is already available for some cloud services like S3, but it would be nice if we could just do something like: // expires after 20 minutes
$duration_in_seconds = 20*60;
$post->firstMedia('thumbnail')->getUrl($duration_in_seconds); or even something like $post->firstMedia('thumbnail')->expires($duration_in_seconds)->getUrl(); and have it propagate down to which ever disk type is being used. EDIT: useful link |
Hi @pet1330, Thanks for the suggestion. I didn't even know that functionality existed! I will see about adding some handling for it. |
@frasmage can you add connection method to the package
|
Hello to all watchers and contributors (paging @sebdesign),
With the new year approaching, I think it is time to start planning the next major version of this package. Most pressingly, with PHP 5.6 passing into security-only support tomorrow night, I think it is time to drop support for PHP 5.x branch and fully embrace the new features of PHP 7.x. I will be working on this over the next few weeks, as I have time.
A new major version presents an opportunity to add any number of other changes that we want to the codebase. So I would like to ask if there are any new features that should be incorporated into the package at the same time. Is there anything that you would like to see built into the package? Are there any methods that should really be moved or renamed? Noticed any code smells that I overlooked? Now is the time to ask.
Feel free to make any suggestions in this thread. Pull Requests also very much welcome!
The text was updated successfully, but these errors were encountered: