PHPackages                             kwidoo/mere - 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. kwidoo/mere

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

kwidoo/mere
===========

Core menu and resource functionality

1.1.2(1y ago)06MITPHPPHP ^7.4|^8.0CI failing

Since Mar 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kwidoo/mere)[ Packagist](https://packagist.org/packages/kwidoo/mere)[ Docs](https://github.com/kwidoo/mere)[ RSS](/packages/kwidoo-mere/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (6)Used By (0)

`

Kwidoo Mere
===========

[](#kwidoo-mere)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bb44bd81174e2d625ee84c60e989e7d609f6b87c9624fcfebd9de74f937e2a28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b7769646f6f2f6d6572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kwidoo/mere)[![Total Downloads](https://camo.githubusercontent.com/4320b6f16a60fbbc9da54e8e8e1cbe710e760649cf591f1305ed518a70f8afdf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b7769646f6f2f6d6572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kwidoo/mere)[![GitHub Actions](https://github.com/kwidoo/mere/actions/workflows/tests.yml/badge.svg)](https://github.com/kwidoo/mere/actions/workflows/tests.yml/badge.svg)

---

**Mere = Menu + Resource**Reusable backend core for Laravel apps with Vue frontends, providing dynamic menu definitions, resource scaffolding, and centralized configuration for forms, validation, and permissions.

---

✨ Features
----------

[](#-features)

- 🌲 **Menu definitions stored in DB** (`MenuItem`)
- 🧩 **Automatic props generation** from model structure
- 🧪 **Reusable validation rules** across Laravel + Vue
- 🔐 **Action-level permissions** (create/edit/delete)
- 🧠 **Shared base service** for clean CRUD logic
- 📦 Uses `Prettus Repository`, `Fractal`, `NestedSet`
- 🧰 Includes Artisan command for syncing menu structure

---

⚙️ Installation
---------------

[](#️-installation)

```
composer require kwidoo/mere
```

### Optional config publish:

[](#optional-config-publish)

```
php artisan vendor:publish --provider="Kwidoo\Mere\MereServiceProvider"
```

---

📁 MenuItem Structure
--------------------

[](#-menuitem-structure)

The `MenuItem` model defines Vue frontend routes:

FieldDescription`name`Format: `ResourceAction` (e.g. `PropertyList`)`path`Vue route path (e.g. `/properties`)`component`Vue component name (`GenericResource`, `GenericCreate`, etc.)`props`Configuration for fields, rules, actions, and label### Example:

[](#example)

```
{
  "label": "properties",
  "fields": [
    { "key": "name", "label": "Name", "sortable": true, "visible": true }
  ],
  "rules": {
    "name": "required|string|max:255"
  },
  "actions": {
    "create": true,
    "edit": true,
    "delete": false
  }
}
```

---

🧪 Syncing Menus via Artisan
---------------------------

[](#-syncing-menus-via-artisan)

You can auto-generate menu definitions using your model and form requests:

```
php artisan mere:sync-menu --resource=Property
```

This will:

- Use `App\Models\Property`'s `$fillable` and `$appends` for `fields`
- Extract rules from `PropertyCreate` and `PropertyUpdate` FormRequests
- Generate or update the following `MenuItem`s:
    - `PropertyList`
    - `PropertyCreate`
    - `PropertyUpdate`

You can override the default Vue component:

```
php artisan mere:sync-menu --resource=Property --component=MyCustomPage
```

---

🧰 BaseService
-------------

[](#-baseservice)

Extendable abstract service with automatic:

- Repository injection
- Validation
- CRUD event dispatching

```
class PropertyService extends BaseService {
    protected function eventKey(): string {
        return 'property';
    }
}
```

---

📦 ResourceController
--------------------

[](#-resourcecontroller)

Generic controller for all resource endpoints. Works with:

```
GET    /api/{resource}
GET    /api/{resource}/{id}
POST   /api/{resource}
PUT    /api/{resource}/{id}
DELETE /api/{resource}/{id}
```

Bind the service using a middleware or config map:

```
// config/mere.php
'resources' => [
    'property' => \App\Services\PropertyService::class,
]
```

---

🧱 BaseRequest
-------------

[](#-baserequest)

Dynamic rules resolver:

```
// POST /api/property => PropertyCreate
// PUT /api/property/{id} => PropertyUpdate
```

It pulls rules from `MenuService::getRules()` using route segments.

---

🧠 Component Detection
---------------------

[](#-component-detection)

Each `MenuItem` can specify a `component` such as:

- `GenericResource` (list page)
- `GenericCreate` (create form)
- `GenericUpdate` (edit form)

This is saved as a top-level DB column and **not inside props**.

---

📚 API Overview
--------------

[](#-api-overview)

### MenuService

[](#menuservice)

```
getMenus(): Collection
getFields(string $name): array
getRules(string $name): array
```

### ResourceCollection

[](#resourcecollection)

```
(new ResourceCollection(...))
    ->fields([...])
    ->label('properties')
    ->canCreate(true)
```

---

🧪 Testing &amp; Extensibility
-----------------------------

[](#-testing--extensibility)

- All services can be tested via Laravel’s container
- You can register custom presenters, validators, or transformers
- Easy to extend with custom menu fields, UI configs, or ACL logic

---

🚧 TODO
------

[](#-todo)

- Add granular permission checks
- Add support for `redirect`, `children` in MenuItem tree
- Sync command enhancements: guessing types, dry-run mode
- Optional: type-based component mapping

---

📃 License
---------

[](#-license)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Total

5

Last Release

422d ago

Major Versions

0.9.0 → 1.0.02025-03-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/40e08f40bb6cff697b1703ccab1a57f3bd327faedf429df8e588d325a76de9f8?d=identicon)[samsite](/maintainers/samsite)

---

Top Contributors

[![kwidoo](https://avatars.githubusercontent.com/u/14920653?v=4)](https://github.com/kwidoo "kwidoo (11 commits)")

---

Tags

merekwidoo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kwidoo-mere/health.svg)

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4205.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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