PHPackages                             sheenazien8/hascrudactions - 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. sheenazien8/hascrudactions

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

sheenazien8/hascrudactions
==========================

CRUD tirelessly 💤

1.0.6(5y ago)184MITPHPPHP ^7.4

Since Nov 14Pushed 5y ago2 watchersCompare

[ Source](https://github.com/sheenazien8/hascrudactions)[ Packagist](https://packagist.org/packages/sheenazien8/hascrudactions)[ Docs](https://github.com/sheenazien8/hascrudactions)[ RSS](/packages/sheenazien8-hascrudactions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (20)Used By (0)

[![](https://camo.githubusercontent.com/22ebb7f7665b2c34e2a6afb10de0fef8befa2c48bd965873ee9c336703be7536/68747470733a2f2f692e6962622e636f2f76774e337667322f47726f75702d332e706e67)](https://camo.githubusercontent.com/22ebb7f7665b2c34e2a6afb10de0fef8befa2c48bd965873ee9c336703be7536/68747470733a2f2f692e6962622e636f2f76774e337667322f47726f75702d332e706e67)

Hascrudaction
=============

[](#hascrudaction)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5b5541e30b2524115a1104dcf24a12f14fd1d048bf63aab792f2313f217a15fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736865656e617a69656e382f68617363727564616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sheenazien8/hascrudactions)[![Build Status](https://camo.githubusercontent.com/3412133f011c9f74ffe21b35d454e330d740f7daf6922671614a5820c29af80a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736865656e617a69656e382f68617363727564616374696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sheenazien8/hascrudactions)[![Total Downloads](https://camo.githubusercontent.com/2008bd6e1003521f506c4d86b7f90d91cd9f678523346876b474432721d6fc29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736865656e617a69656e382f68617363727564616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sheenazien8/hascrudactions)

This package allows you to build a CRUD with tiny Controller and keep the pattern are consitent.

Lifecycles
----------

[](#lifecycles)

MethodPathFunctionRepository FunctionRoute NameGETbase\_domain/path/ControllerClass@indexRepositoryClass@datatablepath.indexGETbase\_domain/path/createControllerClass@create-----path.createGETbase\_domain/path/{id}ControllerClass@show-----path.showPOSTbase\_domain/path/ControllerClass@storeRepositoryClass@createpath.storeGETbase\_domain/path/{id}ControllerClass@edit-----path.editPUTbase\_domain/path/{id}ControllerClass@updateRepositoryClass@updatepath.updateDELETEbase\_domain/path/{id}ControllerClass@destroyRepositoryClass@deletepath.destroyDELETEbase\_domain/bulkDestroy/ControllerClass@bulkDestroyRepositoryClass@bulkDestroypath.bulkDestroyRequirements
------------

[](#requirements)

- laravel 8.^ **On Development**
- laravel 7.^
- This package uses `yajra/laravel-datatables` () for index table view under the hood, Please make sure you include this dependencies before using this library.

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

[](#installation)

You can install the package via composer:

```
composer require sheenazien8/hascrudactions
```

Configuration
-------------

[](#configuration)

#### Laravel Configuration

[](#laravel-configuration)

```
php artisan vendor:publish --provider="Sheenazien8\Hascrudactions\HascrudactionsServiceProvider"
```

#### Register the provider class in config/app.php

[](#register-the-provider-class-in-configappphp)

```
"providers" => [
    Sheenazien8\Hascrudactions\HascrudactionsServiceProvider::class,
]
```

#### Lumen Configuration

[](#lumen-configuration)

```
mkdir -p config
cp vendor/sheenazien8/hascrudactions/config/config.php config/config.php
```

Basic Usage
-----------

[](#basic-usage)

First, Generate the Hascrud route with `php artisan hascrudaction:make Employee` this command will be generate a few class and file views, Example.

- App\\Http\\Controllers\\EmployeeController
- App\\Http\\Requests\\Employee\\.\*
- App\\Repositories\\EmployeeRepository
- resources/views/employee/.\*

And Setup the datatable.

### Install Datatable Package and Setup

[](#install-datatable-package-and-setup)

#### Install Composer

[](#install-composer)

`composer require yajra/laravel-datatables`

#### Install Assets

[](#install-assets)

`yarn add datatables.net-bs4 datatables.net-buttons-bs4`

#### Register datatables.net in resources js and css file

[](#register-datatablesnet-in-resources-js-and-css-file)

```
// Js file
require('bootstrap');
require('datatables.net-bs4');
require('datatables.net-buttons-bs4');

// Scss file
@import "~datatables.net-bs4/css/dataTables.bootstrap4.css";
@import "~datatables.net-buttons-bs4/css/buttons.bootstrap4.css";

```

#### Compile Assets

[](#compile-assets)

`yarn dev / watch / prod`

Next, you can add the path in `routes/web.php`, edit file config in `config/hascrudactions.php` for wrapper blade layouts and javascript views, add Traits `HasLaTable` in Model Class Employee.

#### routes/web.php

[](#routeswebphp)

```
Route::hascrud('employee');
```

#### config/hascrudactions.php

[](#confighascrudactionsphp)

```
/**
 * Wrapper view, you can adjust static view like footer and header
 * put file in views path
 * layouts:
 * section:
 * javascript:
 */
'wrapper' => [
    'layouts' => 'layouts.app',
    'section' => 'content',
    'javascript' => 'javascript'
]
```

#### app/Employee.php

[](#appemployeephp)

```
use Sheenazien8\Hascrudactions\Traits\HasLaTable;

class Employee extends Model
{
    use HasLaTable;
    //
}
```

And the last, you can define what columns you want to display in the index view in `resources/views/employee/components/table.blade.php`, and then you must define what columns you want to add or edit in the model `Employee` with `$fillable` property and form view `resources/views/employee/components/form.blade.php`, and also you can get the binding data from controller with the `$data` variable name.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Credits
-------

[](#credits)

- [Sheena Zien](https://github.com/sheenazien8)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Recently: every ~26 days

Total

18

Last Release

1837d ago

Major Versions

0.1.07-beta → 1.0.02021-01-15

PHP version history (3 changes)0.0.1PHP ^7.1

0.1.01PHP ^7.2.5

1.0.5PHP ^7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ed1a4b2439b93f675e34da1edd32c374924e53bb2eb0843bdd727f46a9412bb?d=identicon)[sheenazien8](/maintainers/sheenazien8)

---

Top Contributors

[![sheenazien8](https://avatars.githubusercontent.com/u/37477023?v=4)](https://github.com/sheenazien8 "sheenazien8 (81 commits)")

---

Tags

sheenazien8hascrudactions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sheenazien8-hascrudactions/health.svg)

```
[![Health](https://phpackages.com/badges/sheenazien8-hascrudactions/health.svg)](https://phpackages.com/packages/sheenazien8-hascrudactions)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
