PHPackages                             artinict/laravel-customs - 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. artinict/laravel-customs

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

artinict/laravel-customs
========================

A cleaner way to import classes in Laravel.

v2.3(7y ago)152211MITPHPPHP ^5.5.9 || ^7.0

Since Mar 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/28TH/laravel-customs)[ Packagist](https://packagist.org/packages/artinict/laravel-customs)[ RSS](/packages/artinict-laravel-customs/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

[![Laravel Customs Logo](https://user-images.githubusercontent.com/25490343/54197915-75f8da80-44c5-11e9-853f-38ee57e5b365.PNG)](https://user-images.githubusercontent.com/25490343/54197915-75f8da80-44c5-11e9-853f-38ee57e5b365.PNG)

Laravel Customs
===============

[](#laravel-customs)

LaravelCustoms (LC) is a package that provides a cleaner way to import your classes and third-party packages. You can think of it this way: Composer manages your dependencies, Customs regulates your imports.

LC uses a concept known as IOCA (Import Once Call Anywhere).

> If you don't want to use this concept, LC will automatically import the class on the fly. (See "Automatic Resolving" below)

Table of Contents
-----------------

[](#table-of-contents)

1. [Installation](https://github.com/28TH/laravel-customs/blob/master/README.md#installation)
2. [Usage](https://github.com/28TH/laravel-customs/blob/master/README.md#usage)
3. [Import Once Call Anywhere (IOCA)](https://github.com/28TH/laravel-customs/blob/master/README.md#import-once-call-anywhere-ioca)
4. [Customs Configuration](https://github.com/28TH/laravel-customs/blob/master/README.md#customs-configuration)
5. [Auto Resolve](https://github.com/28TH/laravel-customs/blob/master/README.md#auto-resolve)
6. [Credits](https://github.com/28TH/laravel-customs/blob/master/README.md#credits)
7. [License](https://github.com/28TH/laravel-customs/blob/master/README.md#license)

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

[](#installation)

```
composer require artinict/laravel-customs

```

```
{
"require": {
      "php": ">=5.3.0"
    }
}

```

If the installation was successful, a `cusfiguration.php` will be created in the Laravel's `config` directory.

> NB: If you don't find the `cusfiguration.php` in `config`, copy the `cusfiguration.php` in the `$BASE_DIR.\vendor\artinict\laravel-customs\src\` to `$BASE_DIR.\config\`
>  Or:
>  Import LaravelCustoms at the top of any of your classes and run the app. Now check `config` directory for `cusfiguration.php`

Usage
-----

[](#usage)

Import `LaravelCustoms` as `LC` at the top of your class.

```

use Artinict\LaravelCustoms as LC;

/*
instead of:
use App\Drinks\Pepsi;
use App\User;
...
*/

```

Then you can access the `LaravelCustoms` instance like so:

```

LC::Pepsi()::okurrr();

```

The general syntax is `LC::[Prefix_]Classname('methodName', [args]);`. Below is how you would use `LC` in a real project.

**Typically, you would do this:**

```
