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 5d 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 19% 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

4239d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/daa810c2b94be273599a10ebeeb8b1a55ef77b570fb92209730650fad1339788?d=identicon)[alexwenzel](/maintainers/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

[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)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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