PHPackages                             michaeltintiuc/laravel-component - 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. michaeltintiuc/laravel-component

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

michaeltintiuc/laravel-component
================================

Several starter interfaces and abstract classes for a laravel project

v0.1(8y ago)135[1 issues](https://github.com/michaeltintiuc/laravel-component/issues)MITPHPPHP &gt;=5.6.4

Since Dec 14Pushed 8y agoCompare

[ Source](https://github.com/michaeltintiuc/laravel-component)[ Packagist](https://packagist.org/packages/michaeltintiuc/laravel-component)[ RSS](/packages/michaeltintiuc-laravel-component/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

laravel-component
=================

[](#laravel-component)

💡 Several starter interfaces and abstract classes for laravel projects

Contents
--------

[](#contents)

1. [Installation](#installation)
2. [Usage](#usage)
3. [Contribution](#contribution)

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

[](#installation)

Require via composer

```
composer require michaeltintiuc/laravel-component
```

Usage
-----

[](#usage)

### Directory structure

[](#directory-structure)

`app/Components/` - holds all component dirs like Users, Posts, Tags, etc

`app/Components/Users` - holds the model class (i.e. User) and all environment dirs like Admin, Site, etc

`app/Components/Users/{ENV}` - holds all classes and `routes.php` related to the environment specific implementation of a component

`app/Components/Users/{ENV}/Requests` - holds form validation classes specific to an environment and component

---

### Controllers

[](#controllers)

```
namespace Acme\Components\Users\Admin;

use Illuminate\Http\Request;
use MichaelT\Component\Admin\ComponentController;

class UsersController extends ComponentController
{
    public function __construct(Request $request, PostTagsRepo $repo)
    {
        parent::__construct($request, $repo);
        $this->setComponent('user');
        $this->setBaseView('admin.users');
        $this->setSearchRoute('admin.users.index');
    }

    public function index(Request $request)
    {
        if ($request->has('search')) {
            return $this->search($request->search);
        }

        $this->setTitle('All users');
        $this->setHeading('Users list');
        $users = $this->repo->all();

        return $this->view('index')
            ->with(compact('users'));
    }

    ...
}
```

---

### Repositories

[](#repositories)

#### Interfaces *aka* Contracts

[](#interfaces-aka-contracts)

```
namespace Acme\Components\Users\Admin;

use MichaelT\Component\Admin\Contracts\RepoContract;
use MichaelT\Component\Admin\Contracts\Searchable;

interface UsersRepoContract extends RepoContract, Searchable
{
}
```

#### Repository

[](#repository)

```
namespace Acme\Components\Users\Admin;

use Acme\Components\Users\User;
use MichaelT\Component\Admin\ComponentRepo;
use Acme\Components\Users\Admin\UsersRepoContract;

class UsersRepo extends ComponentRepo implements UsersRepoContract
{
    public function __construct(User $model)
    {
        parent::__construct($model);
        $this->setComponent('user');
    }

    public function all()
    {
        return $this->model->get();
    }

    public function paginate()
    {
        return $this->model
            ->paginate($this->getPerPage());
    }

    public function find($id)
    {
        try {
            return $this->model->findOrFail($id);
        } catch (\Exception $e) {
            throw new \FindAdminException($this->error('find'));
        }
    }

    ...
}
```

---

### Routes

[](#routes)

#### Component

[](#component)

```
Route::group(['namespace' => 'Acme\Components\Users\Admin'], function () {
    Route::resource('users', 'UsersController');
});
```

#### Loading routes

[](#loading-routes)

```
Route::group(['prefix' => 'admin', 'as' => 'admin.'], function () {
    Route::group(['middleware' => ['auth']], function () {
        require_once app_path().'/Components/Users/Admin/routes.php';
    });
});
```

---

### Contribution

[](#contribution)

Contributions, bug-reports, feature and pull requests are always welcome!

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.5% 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

Unknown

Total

1

Last Release

3273d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1321256?v=4)[Michael Tintiuc](/maintainers/michaeltintiuc)[@michaeltintiuc](https://github.com/michaeltintiuc)

---

Top Contributors

[![michaeltintiuc](https://avatars.githubusercontent.com/u/1321256?v=4)](https://github.com/michaeltintiuc "michaeltintiuc (64 commits)")[![olivernybroe](https://avatars.githubusercontent.com/u/5870441?v=4)](https://github.com/olivernybroe "olivernybroe (1 commits)")

---

Tags

abstractboilerplatehelperinterfacelaravellaravelhelperinterfaceclassbaseabstract

### Embed Badge

![Health badge](/badges/michaeltintiuc-laravel-component/health.svg)

```
[![Health](https://phpackages.com/badges/michaeltintiuc-laravel-component/health.svg)](https://phpackages.com/packages/michaeltintiuc-laravel-component)
```

###  Alternatives

[barryvdh/laravel-ide-helper

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

14.9k132.8M871](/packages/barryvdh-laravel-ide-helper)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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