Download the PHP package finnwiel/shazzoo-media without Composer

On this page you can find all versions of the php package finnwiel/shazzoo-media. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package shazzoo-media

Shazzoo Media

Packagist Version Laravel Filament PHP

A Laravel + Filament plugin that extends Filament Curator with custom media conversion logic and a customized media model.



Installation

⚠️ Important: Before installing, make sure the GD extension is enabled in your php.ini. Without it, image conversions will fail and no thumbnails will be generated.

You can install the package via composer then run the installation command:

If you installed Curator before Shazzoo Media, you’ll need to remove Curator’s media table migration manually before running the install command.

Note: This plugin will install Curator for you, but you still need to set up your Filament panel theme.

Import Curator's stylesheet in your Filament panel theme CSS file.

Add Curator and Shazzoo Media views to your theme sources.

Usage

Global settings

The plugins settings can be managed through the config file

Note: This plugin will also change some of curators settings, you can still manage curators setting but they may not work with Shazzoo Media

To publish the plugins Model run:

Important: When publishing the model make sure to also change the model in the config.


Filament Panels

If you are using Filament Panels you will need to add the Plugin to your Panel's configuration. This will register the plugin's resources with the Panel. All methods are optional, and will be read from the config file if not provided.


Picker field

Shazzoo Media adds a conversions method to the picker field, this method accepts an array. The conversions will subsequently be set in the database for each array item. Shazzoo Media will also create the conversion image.

The picker also has a fileType method, this accepts the following strings: 'image', 'icon', 'document'.

Commands Tags
image jpeg png, webp, gif
icon svg
document pdf docx

To generate actually set the conversions in the database you need to add a trait to the create and edit classes of your resource.


Conversions

Conversions are set in config/shazzoo_media.php in the conversions array. To add or remove conversions change the array with the same structure.

So adding a new conversion called small would look like this:

As you can see the existing conversions can also be edited, this can even be done when some conversions have already been made. Just be sure to run the php artisan media:conversions:regenerate command. This will regenerate the conversions to the new sizes.


Showing images

To show images in your frontend using the ShazzooMedia model, you can leverage the built-in dynamic URL accessors for media conversions.

For each image conversion defined in your config (shazzoo_media.conversions), a dynamic property is available on your media model:

If the conversion file exists, it returns the converted image URL. If not, it gracefully falls back to the original image URL.

Example in blade:

Defining relationships

You are responsible for defining the relationship between your Eloquent models and the media records.

One-to-One Example:

For a model that has a single media item, like a Post with a featured image:

Usage:

One-to-Many Example:

For a model that has multiple images, like a Product with a gallery:

Usage:


Artisan commands

The Shazzoo Media plugin uses some artisan commands. Commands Tags Uses
media:clear - Clears your image files from the storage folder.
media:clear-conversions - Clears your image conversion files from the storage folder.
media:conversions:clear-db id Clears conversion(s) in the database.
media:conversions:set-db id append Sets conversion(s) in the databse.
media:conversions:generate id all only Generates the conversions for the images.
media:conversions:regenerate id only Regenerates the conversions for the images.
media:conversions:list - Lists out all image conversions

Policies & Tenancy

Policies

The Shazzoo Media library doesn't use a policy by default but lets you publish a policy template.

This will publish a policy file to App/Policies/MediaPolicy.php the policy should be registered automatically by the plugin. The published file will be a blank policy, you will need to add your own rules. Also make sure that media_policies is set to true in the config/shazzoo_media.php.

Tenancy

This package does not implement tenancy or user-based access control out of the box.

If your application requires scoping media by tenant, team, or user, you are responsible for applying your own global scope to the ShazzooMedia model. This can be done by publishing the model and implementing it there, or you can add the global scope in the AppServiceProvider.php's boot function.


All versions of shazzoo-media with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0 || ^12.0 || ^13.0
intervention/image Version ^3.9
livewire/livewire Version ^4.1
filament/filament Version ^5.0
awcodes/filament-curator Version ^5.0
spatie/laravel-package-tools Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package finnwiel/shazzoo-media contains the following files

Loading the files please wait ...