Download the PHP package weremagine/laravel-traits without Composer

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

Laravel Traits

A collection of opinionated traits for Laravel, by REMAGINE.

composer require weremagine/laravel-traits

TOC

HasCreator

HasCreator automatically adds the current authorised user's id to the user_id column on record creation of models that implement it.

Usage

HasImages

HasImages automatically appends images on retrieval of models that implement it.

imagesArray function *required A multidimensional array containing:

imagePrefix function (optional) The string to prefix all appended attributes with. If omitted, the field specified will be returned as it is stored.

Usage

HasOne

HasOne automatically adds a differing related model relationship, where

$has_one_attribute property (optional) The name to use when setting the relationship, defaults to model.

$has_one_type property (optional) The name of the field that contains the path to related model class, such as the value App\Models\Menu - defaults to model_type.

$has_one_id property (optional) The name of the field that contains the related model's id - defaults to model_id.

Usage

HasSlug

HasSlug automatically sets a slug when saving (creating or updating) any models that implement it.

$sluggify property (optional) The field name to use when creating the slug - defaults to name.

Usage

HasUniqueKey

HasUniqueKey automatically sets a unique key when creating records for models that implement it.

$unique_key property (optional) The field name to use when creating the unique key - defaults to key.

$unique_key_length property (optional) The length you wish for the unique key to be - defaults to 10.

$uppercase_key property (optional) A boolean to indicate if keys should be in uppercase - defaults to false.

$key_prefix property (optional) The prefix for the unique key. - defaults to null.

$key_suffix property (optional) The suffix for the unique key. - defaults to null.

Usage

HasUuid

HasUuid automatically sets a uuid when creating records for models that implement it.

$uuid_field property (optional) The field name to use when creating the uuid - defaults to uuid.

Usage

Methods

byUuid Retrieves a record using it's UUID.

UserAgent

UserAgent automatically adds the user-agent header specified in the request to an agent field when new records of a model are stored.

$parse_agent_fields property (optional) A boolean to indicate whether or not to parse the agent string and store on creation - defaults to false.

The following fields (nullable strings) are stored:

Usage


All versions of laravel-traits with dependencies

PHP Build Version
Package Version
Requires jenssegers/agent Version ^2.6
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 weremagine/laravel-traits contains the following files

Loading the files please wait ....