Download the PHP package digitaldream/photo without Composer
On this page you can find all versions of the php package digitaldream/photo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitaldream/photo
More information about digitaldream/photo
Files in digitaldream/photo
Package photo
Short Description Image manager
License MIT
Homepage https://github.com/digitaldreams/photo
Informations about the package photo
Laravl Photo Manager
Laravel Photo Manager
Installation
Step one
Step Two Run Migration
Step Three
It will publish config, views file. Feel free to edit these files according to your project need.
Step Four
Browse /photo/photos to start using this library
Configure Policy
You can configure who can have what permissions on this photo library.
Create a new class and extends it from Photo\Policies\PhotoPolicy
like below.
As you can see we override viewAny method. Now a Teacher can view list of all photos.
Other methods like before
,view
,create
,update
,delete
can be override too.
Now to register this Policy class lets change policy
key on config/photo.php
#file config/photo.php
'policy' => \App\Policies\PhotoPolicy::class,
Features
1.Drag and Drop from Web.
2.Drag and Drop from Local machine
3.Crop and Resize
4.Webp conversion
5.Copy image URL and share to the Web
7.Size configurable and thumbnails generation
8.SEO friendly filename.
9.Translation
10.PHPunit test classes included.
How to use in a Model as BelongsTo
First of all you need to put a line on your model migration for example posts.
Secondly you need to define relation on your model.
Third. Lets make upload on controller.
You must resolve \Photo\Repositories\PhotoRepository
via __construction
Dependency injection.
Finally. Its time to render image to view.
This will render following html code.
Above code will render thumbnails in both webp and uploaded extension. To render larger image do following
Here render method take class name as first argument and style as second.
How to upload file and get file path only.
All versions of photo with dependencies
laravel/framework Version ^10.0|^11.0
intervention/image Version ^3.5
jenssegers/imagehash Version ^0.4.2
guzzlehttp/guzzle Version ^7.8.1