PHPackages                             waka/laravel\_yamlforms - 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. waka/laravel\_yamlforms

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

waka/laravel\_yamlforms
=======================

This is my package yamlforms

0.0.4(3y ago)014[2 PRs](https://github.com/charlesStOlive/laravel-yaml-forms/pulls)MITPHPPHP ^8.1

Since Mar 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/charlesStOlive/laravel-yaml-forms)[ Packagist](https://packagist.org/packages/waka/laravel_yamlforms)[ Docs](https://github.com/waka/yamlforms)[ RSS](/packages/waka-laravel-yamlforms/feed)WikiDiscussions master Synced 1mo ago

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

Test package for INERTIA, VUE, Tailwind &amp; yaml
==================================================

[](#test-package-for-inertia-vue-tailwind----yaml)

This package should not used in production

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

[](#installation)

You can install the package via composer:

```
composer require waka/laravel_yamlforms
```

You can publish the config file with:

```
php artisan vendor:publish --tag="yamlforms-config"
```

This is the contents of the published config file:

```
return [
];
```

Usage
-----

[](#usage)

This package allow to load YAML directly for forms.

### Directory structure

[](#directory-structure)

```
app
|-Models
    |-yaml
        |-{ModelName}.yaml
    {ModelName}.php

```

### yaml structure

[](#yaml-structure)

- grid : config for grid presentation (index)
- form: config for form ( update/create)
- attributs: (fields list)

```
grid:
    pagination: 15
    defaultOrder: "-order_column"
form:
    url: /bo/tableau/{id}'
    formClass: flex flex-wrap
attributs:
    id:
        field:
            hidden: true
        label: ID
        column:
            hidden: true

    name:
        label: Nom du tableau
        ordorable: true
        searchable: true
        field:
            required: true
            class: w-full md:w-1/2
        column:
            class: font-bold
    slug:
        label: Slug/Code du tableau
        ordorable: true
        searchable: true
        field:
            class: w-full md:w-1/2
            required: [unique, required]
            options:
                preset: name
    tableauTags:
        label: Tags
        field:
            class: w-full
            type: tagList
            optionsData: listTags
            staticOptionsData: staticListTags
            valueFrom: tagsPluckId
            valueProp: id
            label: name
            mode: tags
            closeOnSelect: false
        column:
            valueFrom: joinTags

    description:
        label: descriptions
        field:
            type: textArea
            required: [required,max:500]
        column: false
    order_column:
        label: Ordre
        field: false
        ordorable: true
        context: [create, update]
    image:
        label: image
        type: fileUploader
        mode: image
        context: create
        column:
            valueFrom: thumb
        field:
            valueFrom: imageBigThumb
            class: w-96 mx-auto
    painted_at:
        label: Paint le
        mode: date
        format: short
        required: ['date']
        ordorable: true
    metas:
        label: Meta Données
        type: nestedform
        blocClass: m-1 p-1 bg-red-500
        class: w-full
        nestedClass: w-full flex flex-wrap
        required: ['array']
        column: false
        attributs:
            propa:
                label: Propd A
                column: false
                type: label
                field:
                    class: w-1/3
            propb:
                label: Propd B
                column: false
                type: label
                field:
                    class: w-1/3
            propc:
                label: Propd C
                column: false
                type: label
                context: ['create']
                field:
                    class: w-1/3

```

### Model

[](#model)

```
use Waka\YamlForms\YamlFormsTrait;
use Waka\YamlForms\YamlFormsInterface;

class Tableau extends Model implements YamlFormsInterface
{
    use YamlFormsTrait;
    ...
}
```

### Controller

[](#controller)

```
//in this exemple we are using spaties querybuilder
use App\Models\Tableau;
use Spatie\QueryBuilder\QueryBuilder;

class TableauController extends Controller
{
    private $orderInverted = true;

    public function index()
    {
        $globalSearch = AllowedFilter::callback('global', function ($query, $value) {
            $query->where(function ($query) use ($value) {
                Collection::wrap($value)->each(function ($value) use ($query) {
                    $query->orWhere('name', 'LIKE', "%{$value}%");
                    $query->orWhere('slug', 'LIKE', "%{$value}%");
                    $query->orWhere('description', 'LIKE', "%{$value}%");
                });
            });
        });
        // logger(Tableau::extractFields($columnsConfig));

        $columnsConfig = Tableau::getColumnsConfig();
        $columnsMeta = Tableau::getColumnsMeta();

        $tableaux = QueryBuilder::for(Tableau::class)
        ->defaultSort($columnsConfig['defaultOrder'])
        ->allowedSorts(['id', 'painted_at','name', 'order_column',  'slug', 'updated_at'])
        ->allowedFilters([$globalSearch])
        ->paginate($columnsConfig['pagination'])
        ->withQueryString()
        ->through([Tableau::class, 'dataYamlColumnTransformer']);

        $inertiaData = [
            'tableaux' => $tableaux,
            'metas' => $columnsMeta,
            'columnsConfig' => $columnsConfig,
            'sort' => Request::all('sort'),
            'filter' => Request::all('filter'),
        ];

        return Inertia::render('Tableaux/Index', $inertiaData);
    }

    public function edit(Tableau $tableau)
    {
        //logger('edit');
        $inertiaData = [
            'formData' => $tableau->dataYamlFieldsTransformer(),
            'config' => $tableau->getModelFormConfig()
        ];
        //logger($tableau->getModelFormConfig()['fields']);
        return Inertia::render('Tableaux/Edit', $inertiaData);
    }

    public function create() {
        $inertiaData = [
            'formData' => Tableau::getEmptyForm(),
            'config' => Tableau::getStaticModelFormConfig()
        ];
        return Inertia::render('Tableaux/Create', $inertiaData);
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \App\Http\Requests\StoreTableauRequest  $request
     * @return \Illuminate\Http\Response
     */
    public function store()
    {
        $validationRules = Tableau::getStaticModelValidationRules();
        $tableau = Tableau::create(Request::validate($validationRules));
        $tableau->processImage(Request::get('image'));
        if($tags = Request::get('tableauTags')) {
            $tableau->tableauTags()->sync($tags);
        }
        return to_route('tableaux.index')->with('message', 'Tableau crée');

    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \App\Http\Requests\UpdateTableauRequest  $request
     * @param  \App\Models\Tableau  $tableau
     * @return \Illuminate\Http\Response
     */
    public function update(Tableau $tableau)
    {

        $validationRules = Tableau::getStaticModelValidationRules();
        $tableau->update(Request::validate($validationRules));
        $tableau->processImage(Request::get('image'));
        if($tags = Request::get('tableauTags')) {
            $tableau->tableauTags()->sync($tags);
        }
        // return redirect()->back()->with('message', 'Tableau  mis à jour');;
        return to_route('tableaux.index')->with('message', 'Tableau crée');
    }
```

Testing
-------

[](#testing)

```
Test is not working
// composer test
```

Credits
-------

[](#credits)

- [Charles](https://github.com/charlesStOlive)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

2

Last Release

1156d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58bb7d561320f11f7dae8e1ddf869679a56a2739a1c83ab7679125b0631d32e3?d=identicon)[charlesstolive](/maintainers/charlesstolive)

---

Top Contributors

[![charlesStOlive](https://avatars.githubusercontent.com/u/41335991?v=4)](https://github.com/charlesStOlive "charlesStOlive (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

laravelWakayamlforms

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/waka-laravel-yamlforms/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M626](/packages/spatie-laravel-data)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

9169.0k4](/packages/marcelweidum-filament-expiration-notice)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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