PHPackages                             iqbalatma/laravel-utils - 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. iqbalatma/laravel-utils

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

iqbalatma/laravel-utils
=======================

1.5.6(1y ago)02.0kPHP

Since Oct 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iqbalatma/laravel-utils)[ Packagist](https://packagist.org/packages/iqbalatma/laravel-utils)[ RSS](/packages/iqbalatma-laravel-utils/feed)WikiDiscussions master Synced today

READMEChangelog (10)DependenciesVersions (22)Used By (0)

Laravel Utils
=============

[](#laravel-utils)

Laravel utils is collection of class, helper, command console for help you to efficiency your development time. Here we have command console for generate enum, abstract, interface, or trait

Config
------

[](#config)

Target dir is where generated file root path. Change this target dir location by your preference.

```
return [
    "target_enum_dir" => "app/Enums",
    "target_trait_dir" => "app/Traits",
    "target_abstract_dir" => "app/Contracts/Abstracts",
    "target_interface_dir" => "app/Contracts/Interfaces",
    "api_response" => [
        "payload_wrapper" => "payload",
        "meta_wrapper" => null
    ],
    "is_show_debug" => env("APP_DEBUG", false)
];
```

Generate File Command
---------------------

[](#generate-file-command)

You can generate enum with this utils You can also create backed enum, with string or int as type

### Enum

[](#enum)

```
php artisan make:enum Gender
php artisan make:enum Gender --type=string
```

You can generate trait with this command

### Trait

[](#trait)

```
php artisan make:trait HasInstitution
```

You can generate abstract with this command

### Abstract

[](#abstract)

```
php artisan make:abstract BaseService
```

You can generate interface with this command

### Interface

[](#interface)

```
php artisan make:inteface IRouter
```

Publish Stub File
-----------------

[](#publish-stub-file)

In some condition you may publish stub file and modify template.

```
php artisan utils:publish-stub
```

Formatting API Response
-----------------------

[](#formatting-api-response)

You can format your api response using this feature. For example :

```
