Download the PHP package akatekno/attachable without Composer

On this page you can find all versions of the php package akatekno/attachable. 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 attachable

Akatekno ID Attachable

This is a simple package to implement multiple attachments in a model. This package is created based on my annoyance for creating the same model and migrations over and over. So this is why I made the Attachable package.

Installation

In your Laravel application, run composer require akatekno/attachable, then run php artisan migrate to create the attachments table.

Usage

There are currently two types of the Attachable available:

  1. AttachableOne if you want to implement only ONE attachment per-model. The case example is the User's profile picture, or the User's identity card.
  2. AttachableMany if you want to implement many attachments per-model. The case example is a Blog's gallery picture, or a Report's attachments.

AttachableOne

The implementation of the code is fairly simple:

  1. Implement the interface AttachableOne and trait AttachableOne

  2. To get the attachment data, use the example below:

This will return the data below:

  1. To store the data to the attachment, use the example below:

AttachableMany

This implementation is more like the same as AttachableOne, the difference is the plural usage of the attachment to attachments.

  1. Implement the interface AttachableMany and trait AttachableMany

  2. To get the attachments data, use the example below:

This will return the data below:

  1. To store the data to the attachment, use the example below:

Custom Relation Name

Because this package is simplifying the MorphOne or MorphMany code usage, you can always modify the relation name to your liking such as:

Now, you have 3 different attachment type in the same attachment table. To get the data in each of the relation by example above, just call the $reservation->visit_request_letter, $reservation->hotel_booking_invoice, or $reservation->other_attachments.

To attach the file, simply add specify the type of the column.

To-dos

We need somebody who willing to spend some time to fix these issues:

After the above issue is fixed, we will make a configuration file so you could fine-tune the package for your liking.


All versions of attachable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2
laravel/framework Version ^10.0|^11.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 akatekno/attachable contains the following files

Loading the files please wait ....