Download the PHP package asb/morphmtm without Composer

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

Feature

Maybe for you, implementing a series of models and repetitive relationships is boring, time-consuming and annoying, and you will have to copy your previous codes or refactor them, which will be a waste of time.\ This package provides you with a module to automatically files need (Model,Migrations,...) add Morph many-to-many relations to your project along with commonly used basic commands.\ which minimizes the trial and error operation for you.

how to use this package :

There is no need to define relationships anymore, and it is enough to Add the necessary Trait Has+yourModel (like this => hasStatus) in the models to which the Model is applied.

Requirements

The package requires PHP 8 or higher. The Laravel package also requires Laravel 10 or higher.

Quick Start

  1. Installation:

    `

  2. publish the package's configuration file by running:

    `

  3. Autoloading

    By default, the module classes are not loaded automatically. You can autoload your modules using _psr-4_. For example:

    "autoload": { "psr-4": { "App\": "app/", "Rack\": "Rack/" } }

    Tip: don't forget to run composer dump-autoload afterward\ In an example to create a category module, I will explain how to use it.

  4. build module:

    php artisan mtm:build *Modulename*

    in continue the command, you will be asked to named, of course, you can confirm and pass the default value by pressed the enter key, but some default words may not be to your liking.`

    Tip: If You need to remove a module you can use this command \ php artisan mtm:remove ModuleName

  5. Add the necessary Trait to your model:

    ``

  6. Use predefined functions:

    • it gets all the models that have Category.

      Tip: all functions is can call static with this format (MTM+modelName):\

      one example : MTMCategory::getModelsHave('new')

    ``

    • it gets all the Categories of Model.

      ``

    • it checks the Model has this Category by Title or ID.

      ``

    • it assigns a Category to the Model by Title or ID.

      ``

    • it adds a Category to the Model by Title or ID.

      ``

    • it updates a Category from the Model and replace by new Category Or a Category that exists.

      ``

    • it removes a Category from the model by Title or ID.

      ``

    • it removes all Categories from the model.

      ``

  7. Using CRUD of Model in Module:

    • it Creates a Category by a new Title.

      ``

    • it gets all of Category And if it is called with "true" parameter, it will get all the deleted Category.

      ``

    • it gets a Category by Title or ID.

      ``

    • updates a Category by Title or ID and replace by a new Title

      ``

    • it removes a Category by Title or ID and removing the Category and from all Models.

      ``

    • it restored a Category by Title or ID.

      ``


All versions of morphmtm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 asb/morphmtm contains the following files

Loading the files please wait ....