PHPackages                             alexwenzel/cmsbasics - 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. alexwenzel/cmsbasics

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

alexwenzel/cmsbasics
====================

A package for Laravel, which I use to build repetitive resource Items.

0.0.1-beta(11y ago)117PHPPHP &gt;=5.4.0

Since Oct 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/alexwenzel/cmsbasics)[ Packagist](https://packagist.org/packages/alexwenzel/cmsbasics)[ RSS](/packages/alexwenzel-cmsbasics/feed)WikiDiscussions development Synced 3w ago

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

my cms basics for laravel
=========================

[](#my-cms-basics-for-laravel)

A package for Laravel, which I use to build repetitive resource Items.

Model
-----

[](#model)

Create a model for your new resource item.

The resource model should have a static `$rules` property, which contain all resource rules.

```
class Post extends \Eloquent {

  protected $table = 'posts';
  protected $fillable = ['title', 'body'];

  public static $rules = [
    'title' => 'required',
    'body' => 'required',
  ];
}
```

Controller
----------

[](#controller)

Create a new controller by extending the base resource controller. In the constructor you can specify some settings.

- `dependency` =&gt; your resource item's model
- `resource_name` =&gt; the identifier of your resource, the one you use at `Route::resource()`
- `view_dir` =&gt; path to the rescource views

```
use Alexwenzel\Cmsbasics\Controllers\Resource;

class PostsController extends Resource {

  public function __construct(Post $model)
  {
    parent::__construct([
      'dependency'    => $model,
      'resource_name' => 'posts',
      'view_dir'      => 'path.to.views',
    ]);
  }
}
```

Then register the controller in your routes.

```
Route::resource('posts', 'PostsController');
```

### Customize behaviour

[](#customize-behaviour)

You cann customize the behaviour of the base resource controller by overriding specific methods

```
protected function _index_items()
protected function _store_data()
protected function _store_validator($data)
protected function _store_fails($data, $validator)
protected function _store_finished($data, $model)
protected function _update_data()
protected function _update_validator($id, $data)
protected function _update_fails($data, $model, $validator)
protected function _update_finished($data, $model)
protected function _destroy_finished()
```

### Events

[](#events)

The following Events are fired within the base resource controller:

**index**

```
[resource_name].index

```

**create**

```
[resource_name].create

```

**store**

```
[resource_name].store

```

Passes the newly created resource as the first argument.

**show**

```
[resource_name].show

```

Passes the requested resource as the first argument.

**edit**

```
[resource_name].edit

```

Passes the requested resource as the first argument.

**update**

```
[resource_name].update

```

Passes the updated resource as the first argument.

**destroy**

```
[resource_name].destroy

```

View
----

[](#view)

This package comes with default views for all actions (index, create, show, edit). Publish the package views as a starting point.

```
php artisan view:publish alexwenzel/cmsbasics

```

Copy the package views to a new folder and customize them.

```
class PostsController extends Resource {

  public function __construct(Post $model)
  {
    parent::__construct([
      'dependency'    => $model,
      'resource_name' => 'posts',
      'view_dir'      => 'path.to.views',
    ]);
  }
}
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

4286d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3659928?v=4)[alexwenzel](/maintainers/alexwenzel)[@alexwenzel](https://github.com/alexwenzel)

---

Top Contributors

[![alexwenzel](https://avatars.githubusercontent.com/u/3659928?v=4)](https://github.com/alexwenzel "alexwenzel (1 commits)")

---

Tags

laravelresource controllerresource item

### Embed Badge

![Health badge](/badges/alexwenzel-cmsbasics/health.svg)

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

###  Alternatives

[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)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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