PHPackages                             nabil12ful/store-data-requests - 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. [Database &amp; ORM](/categories/database)
4. /
5. nabil12ful/store-data-requests

ActiveLibrary[Database &amp; ORM](/categories/database)

nabil12ful/store-data-requests
==============================

Store data to DB by model from requests fields html form

v1.5(3y ago)2521MITPHP

Since Jan 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nabil12ful/store-data-requests)[ Packagist](https://packagist.org/packages/nabil12ful/store-data-requests)[ RSS](/packages/nabil12ful-store-data-requests/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (18)Used By (0)

Store Data Requests for Laravel
===============================

[](#store-data-requests-for-laravel)

> ## Support laravel v8+
>
> [](#support-laravel-v8)

Store data to database from (Form Requsts Fields) by Model

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

[](#installation)

```
composer require nabil12ful/store-data-requests
```

To publish

```
php artisan vendor:publish --provider="Nabil\StoreDataRequestsServiceProvider"
```

Usage
-----

[](#usage)

```
php artisan make:controller UserController -r
```

### Or

[](#or)

```
php artisan make:controller UserController -m User
```

Change this info after controller generation &amp; Congratolations 😄

```
protected $model = \App\Models\User::class;

protected $folderBlade = 'backend.user'; // View folder name OR path

protected $uploadPath = 'upload/user';

protected $columns = [
	// table columns & fields name
	'name',
	'email',
];

protected $mediaColumns = [
    // columns name have a media files like [Image, Pdf, Doc, etc...]
    'image'
];
```

### Views Folder

[](#views-folder)

> ```
> +--- views
> |    +--- backend
> |    |    +--- user
> |    |    |    +--- index.blade.php
> |    |    |    +--- create.blade.php
> |    |    |    +--- edit.blade.php
> |    |    |    +--- show.blade.php
> |    |    +--- product
> |    |    |    +--- index.blade.php
> |    |    |    +--- create.blade.php
> |    |    |    +--- edit.blade.php
> |    |    |    +--- show.blade.php
> |    |    +--- index.blade.php
>
> ```

### To use Vaildation

[](#to-use-vaildation)

Create request validation by

```
php artisan make:request UserStoreRequest
```

```
public function store(UserStoreRequest $request): RedirectResponse
{
	StoreDataRequests::model($this->model)->make($request, $this->columns)->store($this->uploadPath);
}
```

#### Or use

[](#or-use)

First change columns array like:

```
protected $columns = [
	// table columns & fields name with rules
	'name' => 'required|string|min:5',
	'email' => 'required|email',
];

protected $mediaColumns = [
	// table columns & fields name has files with rules
	'image' => 'required|image',
];
```

And use `storeValidated`, `updateValidated` methods

```
public function store(Request $request)
{
	$result = StoreDataRequests::model($this->model)->make($request, $this->columns)->storeValidated('upload/users');

    if(isset($result->id))
    {
        toastr()->success('The data has been stored successfully', 'Success');
        return redirect()->back();
    }else{
        return back()->withInput()->withErrors($result);
    }
}
```

On update

```
public function update($id, Request $request)
{
	$result = StoreDataRequests::model($this->model)->make($request, $this->columns, $this->mediaColumns)->updateHasFilesValidate($id, $this->uploadPath);

    if(!$result)
    {
        toastr()->success('The data has been updated successfully', 'Success');
        return redirect()->back();
    }else{
        return back()->withInput()->withErrors($result);
    }
}
```

Delete records
--------------

[](#delete-records)

Enter path Param If you want to delete files from uploads path with delete a record:

```
StoreDataRequests::model($this->model)->delete(decrypt($id), $this->uploadPath);
```

Use our service in simple Controller
------------------------------------

[](#use-our-service-in-simple-controller)

First import our plugin in your Controller file

```
use Nabil\StoreDataRequests;
```

And write this code to create a new record:

```
public function store(Request $request)
{
	StoreDataRequests::model('Prodect')->make($request, ['title','description'])->store();
}
```

Or write this code to update old record in Database model:

```
public function update(Request $request, $id)
{
	StoreDataRequests::model('Prodect')->make($request, ['title','description'])->update($id);
}
```

Upload files with insert data
-----------------------------

[](#upload-files-with-insert-data)

use:

```
StoreDataRequests::model('Prodect')->make($request, ['title','description'], ['image'])->store('path/to/upload');
```

or update has file:

```
StoreDataRequests::model('Prodect')->make($request, ['title','description'], ['image'])->update($id, 'path/to/upload');
```

### Thanks for Eng/Sameh Mohamed

[](#thanks-for-engsameh-mohamed)

Made with ❤️ By Eng/Nabil Hamada
--------------------------------

[](#made-with-heart-by-engnabil-hamada)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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 ~3 days

Total

17

Last Release

1194d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c51f75c2bd2628cac430387b88a2d42d0713c472b2f2287f1dcf7eaebeccdf1a?d=identicon)[nabil12ful](/maintainers/nabil12ful)

---

Top Contributors

[![nabil12ful](https://avatars.githubusercontent.com/u/31300818?v=4)](https://github.com/nabil12ful "nabil12ful (37 commits)")

### Embed Badge

![Health badge](/badges/nabil12ful-store-data-requests/health.svg)

```
[![Health](https://phpackages.com/badges/nabil12ful-store-data-requests/health.svg)](https://phpackages.com/packages/nabil12ful-store-data-requests)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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