PHPackages                             tarik02/laravel-mixin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tarik02/laravel-mixin

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tarik02/laravel-mixin
=====================

Mixin library for Laravel

v0.1.0(6y ago)02MITPHPPHP &gt;=7.2

Since Jan 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Tarik02/laravel-mixin)[ Packagist](https://packagist.org/packages/tarik02/laravel-mixin)[ RSS](/packages/tarik02-laravel-mixin/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

laravel-mixin
=============

[](#laravel-mixin)

[![Travis CI Build Status](https://camo.githubusercontent.com/4f8a96c8722048a6712f654a68a5152cd6dd03ad47ad8e4a39600eccae96d895/68747470733a2f2f7472617669732d63692e6f72672f546172696b30322f6c61726176656c2d6d6978696e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Tarik02/laravel-mixin)[![Latest Stable Version](https://camo.githubusercontent.com/5f5ad1495bb5096251dfbb891763eb07b9876bbdf2a5883e54855297175f7127/68747470733a2f2f706f7365722e707567782e6f72672f746172696b30322f6c61726176656c2d6d6978696e2f76657273696f6e2e706e67)](https://packagist.org/packages/tarik02/laravel-mixin)[![Total Downloads](https://camo.githubusercontent.com/e50999e4c7e4d19dc8912122e31c7a294ed653d133222aed589cf33374c33722/68747470733a2f2f706f7365722e707567782e6f72672f746172696b30322f6c61726176656c2d6d6978696e2f642f746f74616c2e706e67)](https://packagist.org/packages/tarik02/laravel-mixin)[![Packagist License](https://camo.githubusercontent.com/93f26d832c51cd81a27829ae30a4d442d2792006ee2f9975210c1fbe2d87816d/68747470733a2f2f706f7365722e707567782e6f72672f746172696b30322f6c61726176656c2d6d6978696e2f6c6963656e73652e706e67)](http://choosealicense.com/licenses/mit/)

Take class, some traits and interfaces and put them in one place. For example, add new methods, relations, etc. to existing model without touching it. Very useful for dividing project into packages without loosing ability to improve.

NOTE: This can only be used with special packages which are ready to use this package. See below for more information.

Installation
------------

[](#installation)

```
$ composer require tarik02/laravel-mixin
$ mkdir -p storage/framework/mixin
$ echo "*\n\!.gitignore" > storage/framework/mixin/.gitignore
```

Commands
--------

[](#commands)

The package provides the following commands:

```
$ php artisan mixin:cache        # Cache all mixins and use only cache
$ php artisan mixin:cache:clear  # Clear mixins cache
$ php artisan mixin:generate     # Generate all mixins
```

Cache should only be used in production and be regenerated after every code change.

Documentation
-------------

[](#documentation)

You can generate documentation using the Sami. Documentation for master branch is always available [here](https://Tarik02.github.io/laravel-mixin/).

Note
----

[](#note)

You should use all methods of this package only during application booting phase. Using them during another stages may lead to undefined behaviour.

Usage example
-------------

[](#usage-example)

Create your model class (note, the class is `abstract`):

```
