PHPackages                             nevestul4o/network-controller - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. nevestul4o/network-controller

ActiveLibrary[File &amp; Storage](/categories/file-storage)

nevestul4o/network-controller
=============================

A basic API controller set for laravel

v2.8.4(3w ago)1347MITPHPPHP ^8.0.2

Since Jan 20Pushed 1w ago1 watchersCompare

[ Source](https://github.com/NKozhuharov/NetworkController)[ Packagist](https://packagist.org/packages/nevestul4o/network-controller)[ RSS](/packages/nevestul4o-network-controller/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (6)Versions (74)Used By (0)

NetworkController
=================

[](#networkcontroller)

A Laravel package that provides a powerful, convention-driven base API controller and model foundation for building RESTful endpoints quickly. It includes rich GET query capabilities (pagination, filtering, sorting, search, includes, aggregations), transformers via Fractal, file and image upload helpers, ready-made auth controllers, and more.

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

[](#table-of-contents)

- Requirements
- Installation
- Publish Configuration
- Quick Start
- Models (BaseModel)
- Special Features and Aggregations
- File and Image Uploads
- Auth Controllers (Login and Change Password)
- GET Requests Reference
- Contributing
- License

Requirements
------------

[](#requirements)

- PHP: ^8.0.2
- Laravel: ^9.0 | ^10.0 | ^11.0 | ^12.0
- Extensions: ext-imagick (required for image features)

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

[](#installation)

Install via Composer:

```
  composer require nevestul4o/network-controller
```

Publish Configuration
---------------------

[](#publish-configuration)

The package ships with a publishable configuration file. Use:

```
  php artisan vendor:publish --provider="Nevestul4o\NetworkController\NetworkControllerServiceProvider"
```

This will publish:

- config/networkcontroller.php

Quick Start
-----------

[](#quick-start)

1. Create a controller that extends NetworkController and register a resource route:

```
use App\Http\Controllers\Controller;
use Nevestul4o\NetworkController\NetworkController;

class APIEmployeeController extends NetworkController {}
```

In routes/api.php:

```
use App\Http\Controllers\APIEmployeeController;
use Illuminate\Support\Facades\Route;

Route::resource('employee', APIEmployeeController::class);
```

2. Create a model that extends BaseModel and place it under `App\Http\Models` (as expected by this package):

```
namespace App\Http\Models;

use Nevestul4o\NetworkController\Models\BaseModel;

class Employee extends BaseModel
{
    protected $fillable = ['first_name', 'last_name'];
}
```

3. Optional: Add a Fractal transformer for your model and configure includes as needed.

Now you can call endpoints like GET /api/employee with rich query parameters (see reference below).

Models (BaseModel)
------------------

[](#models-basemodel)

- Abstract class; your application models should extend it.
- Expected location: `App\Http\Models`.
- Ideally, one model maps to one controller that extends NetworkController.

Special Features and Aggregations
---------------------------------

[](#special-features-and-aggregations)

- Advanced ordering (including virtual keys via scopes)
- Safe, predefined aggregations returned under meta.aggregate

Read more and see examples: [BaseModel — Examples](./BaseModelSpecialFeaturesExamples.md).

File and Image Uploads
----------------------

[](#file-and-image-uploads)

Add these routes to routes/api.php:

```
use Nevestul4o\NetworkController\Controllers\ImagesController;
use Nevestul4o\NetworkController\Controllers\UploadController;

Route::get('images/{width}/{name}', [ImagesController::class, 'getImage'])->name('get-image');
Route::post('upload', [UploadController::class, 'uploadSubmit']);
```

Configure your .env:

```
UPLOADS_PATH=../uploads/files
IMAGES_PATH=../uploads/images
IMAGES_RESIZED_PATH=../cache/images
IMAGES_SUPPORTED_SIZES=300,600,900
IMAGES_REMOVE_METADATA=TRUE

```

Maintenance command to clear the resized image cache:

```
  php artisan network-controller:images-clear-cache
```

Auth Controllers (Login and Change Password)
--------------------------------------------

[](#auth-controllers-login-and-change-password)

- Pre-made controllers offering login/logout and password change flows.
- Requires a `User` model under `App\Http\Models` extending `BaseUser`.
- Update the user provider namespace in config/auth.php to `App\Http\Models\User`.
- Requires a `UserTransformer` under `App\Http\Models\Transformers`.
- You can override methods as needed.

Routes (add to routes/api.php):

```
use Nevestul4o\NetworkController\Controllers\Auth\LoginController;
use Nevestul4o\NetworkController\Controllers\Auth\ChangePasswordController;

Route::post('login', [LoginController::class, 'login'])->name('login');
Route::get('login', [LoginController::class, 'login'])->name('getCurrentUser');
Route::post('logout', [LoginController::class, 'logout'])->name('logout');

Route::post('change-password', [ChangePasswordController::class, 'changePassword'])->name('changePassword');
Route::post('change-password-forced', [ChangePasswordController::class, 'changePasswordForced'])->name('changePasswordForced');
```

Warning: changePasswordForced in ChangePasswordController is NOT secured. It can change a user's password without the current password. Protect the route appropriately or override the method.

GET Requests Reference
----------------------

[](#get-requests-reference)

For detailed documentation of the supported GET parameters (pagination, showMeta, sorting, filtering, search, resolve/includes, slugs, aggregations, and more), see:

- [NetworkController GET Requests](./NetworkControllerGETRequests.md)

These docs explain how to use parameters like page, limit, orderby, sort, filters, query, resolve, aggregate and how meta.route\_info helps discover allowed values.

Contributing
------------

[](#contributing)

Issues and pull requests are welcome. Please follow the conventional code style and include tests where possible.

License
-------

[](#license)

MIT

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance96

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

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

Recently: every ~39 days

Total

70

Last Release

25d ago

Major Versions

v1.5.5 → v2.0.02022-05-18

PHP version history (4 changes)v1.0.0PHP &gt;=7

v1.1.0PHP ^7.2.5

v1.5.0PHP ^7.3|^8.0

v2.0.0PHP ^8.0.2

### Community

Maintainers

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

---

Top Contributors

[![NKozhuharov](https://avatars.githubusercontent.com/u/34658461?v=4)](https://github.com/NKozhuharov "NKozhuharov (2 commits)")

---

Tags

apilaravellibraryfilesimagesuploadfractal

### Embed Badge

![Health badge](/badges/nevestul4o-network-controller/health.svg)

```
[![Health](https://phpackages.com/badges/nevestul4o-network-controller/health.svg)](https://phpackages.com/packages/nevestul4o-network-controller)
```

###  Alternatives

[zgldh/laravel-upload-manager

Upload, validate, storage, manage by API for Laravel 5/6/7/8/9

795.5k2](/packages/zgldh-laravel-upload-manager)[erlandmuchasaj/laravel-file-uploader

A simple package to help you easily upload files to your laravel project.

128.7k](/packages/erlandmuchasaj-laravel-file-uploader)[gaspertrix/laravel-backpack-dropzone-field

Add Dropzone support for Laravel Backpack

172.2k](/packages/gaspertrix-laravel-backpack-dropzone-field)

PHPackages © 2026

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