PHPackages                             abdallhsamy/helpers - 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. abdallhsamy/helpers

ActiveLibrary

abdallhsamy/helpers
===================

A Package contains some useful classes to help you develop faster

v1.2.0(4y ago)1019[1 PRs](https://github.com/abdallhsamy/helpers/pulls)MITPHPPHP ^7.4|^8.0

Since Oct 6Pushed 3y agoCompare

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

READMEChangelog (4)Dependencies (6)Versions (7)Used By (0)

Helpers
=======

[](#helpers)

A Package contains some useful classes to help you develop faster

benefits of using package
-------------------------

[](#benefits-of-using-package)

- you will be able to move migration files to sub directories **ex**: `database/migration/company/xxxxx_create_company_contacts_table.php`
- use pagination , filter and search without modifing controller methods or route params . **ex** : `/api/v1/users/search=Abdallah%20Samy&age=27&country_id=27&limit=15`which :
    - @param `search` for search ,
    - @param `age` for filtering
    - @param `country_id` for filtering
    - and @param `limit` for pagination

Migration Directory Example
---------------------------

[](#migration-directory-example)

```
├── migrations
│   ├── Employees
│   │   ├── 2020_07_13_002708_create_xxxxx_table.php
│   ├── General
│   │   ├── 2020_06_25_094724_create_xxxxxx_table.php
│   │   ├── 2020_06_25_154805_create_xxxxxx_table.php
│   ├── Library
│   │   ├── 2020_07_12_131550_create_xxxxxx_table.php
│   │   ├── 2020_07_13_160900_create_xxxxxx_table.php
│   │   ├── 2020_07_13_160903_create_xxxxxx_table.php
│   │   └── 2020_07_13_160904_create_xxxxxx_table.php
│   └── Users
│       ├── 2020_06_14_145802_create_xxxxxx_table.php
│       ├── 2020_06_14_145803_create_xxxxxx_table.php
│       ├── 2020_06_15_110700_create_xxxxxx_table.php
│       └── 2020_08_30_132633_create_xxxxxx_table.php
└── seeds
```

Installation
============

[](#installation)

using Composer
--------------

[](#using-composer)

```
composer require abdallhsamy/helpers
```

Config File and Migrations
--------------------------

[](#config-file-and-migrations)

Publish package config file and migrations with the following command:

```
php artisan vendor:publish --provider="AbbdallhSamy\Helpers\Providers\HelperServiceProvider"
```

Then run migrations:

```
php artisan migrate
```

Traits and Contracts
--------------------

[](#traits-and-contracts)

Model
-----

[](#model)

Add `AbdallhSamy\Helpers\Traits\Models\{ActivityLogTrait, ModelFilters, ModelSearch}` traits to your model.

See the following model example:

```
