Download the PHP package van-ons/filament-attachment-library without Composer

On this page you can find all versions of the php package van-ons/filament-attachment-library. 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 filament-attachment-library

Filament Attachment Library

Latest version on GitHub Total downloads GitHub issues License

Filament package for easy attachment uploading and browsing.

Quick start

Compatibility

For certain Filament versions, changes have to be made that render the package backwards incompatible with the previous version. Please see the table below to determine which version you need.

Version Filament
v2 (current) >=4.0 | >=5.0
v1 <4.0

Please note: the main branch will always be the latest major version.

Installation

The Filament Attachment Library can be installed using Composer by running the following command:

An installation command is available that ensures that the migrations and assets are installed:

The templates in this package use TailwindCSS. To ensure the styling is rendered correctly, a custom Filament theme must be set up, and the tailwind.config.js file should be extended.

Create the custom Filament theme and follow the instructions in the terminal to set it up:

Add the following to the generated theme.css file:

[!NOTE] Make sure to follow the instructions in the terminal to register your custom Filament theme in the admin panel.

If your project is using Vite, you may have to register the custom theme as follows: ->viteTheme('resources/css/filament/[PANEL_NAME]/theme.css', 'build')

By default, this package uses the public disk defined in filesystems.php. This can be overridden by adding the following to the project's .env file:

[!NOTE] It is advised to use a disk without any other files. This prevents file conflicts.

The glide.php and attachment-library.php files contain more configuration options.

Prepare model

Register the plugin in the desired Filament panel:

Usage

The attachment field can be used in two ways: either to store the attachments in a specific column of your model, or to store the attachments in the attachments relationship by using the HasAttachments trait and the relationship() method.

(Optional) Add the HasAttachments trait to your desired model:

This will add the attachments() relationship which links one or more attachments to your model.

Then, in your form schema, add the AttachmentField:

(Optional) When using the relationship() method, you can filter the attachments by collection name. To make this easier you can add a separate relationship method to your model:

Finally, at the front end, the laravel-attachment-library-image Blade component can be used to display attachments as image. Glide is used to scale the image up or down. The src argument may be an Attachment instance, or the id as string/integer.

For more information refer to the Laravel Attachment Library documentation.

Documentation

Please see the documentation for detailed information about installation and usage.

Contributing

Please see contributing for more information about how you can contribute.

Changelog

Please see changelog for more information about what has changed recently.

Upgrading

Please see upgrading for more information about how to upgrade.

Security

Please see security for more information about how we deal with security.

Credits

We would like to thank the following contributors for their contributions to this project:

License

The scripts and documentation in this project are released under the MIT License.


Logo of Van Ons


All versions of filament-attachment-library with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^4.0 | ^5.0
van-ons/laravel-attachment-library Version ^1.2.4
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 van-ons/filament-attachment-library contains the following files

Loading the files please wait ...