LaravelPackages.net
Acme Inc.
Toggle sidebar
mrlaozhou/laravel-indulge

Laravel database field extension

45
0
v1.7
About mrlaozhou/laravel-indulge

mrlaozhou/laravel-indulge is a Laravel package for laravel database field extension. It currently has 0 GitHub stars and 45 downloads on Packagist (latest version v1.7). Install it with composer require mrlaozhou/laravel-indulge. Discover more Laravel packages by mrlaozhou or browse all Laravel packages to compare alternatives.

Last updated

Laravel-Indulge

Install

To install through Composer, by run the following command:

composer require "mrlaozhou/laravel-indulge"

The package will automatically register a service provider and alias.

Optionally, publish the package's configuration file by running:

php artisan vendor:publish --provider="Mrlaozhou\Indulge\LaravelIndulgeServiceProvider"

php artisan indulge:migrate

Document

Config

You can modify the provider at will.

Filepath: config/indulge.php

return [
    'providers'                 =>  [
        /**
         *
         * Indulge option provider
         */
        'option'            =>  \Mrlaozhou\Indulge\Entities\Option::class,

        /**
         *
         * Indulge field provider
         */
        'field'             =>  \Mrlaozhou\Indulge\Entities\Field::class,

        /**
         *
         * Indulge value provider
         */
        'value'             =>  \Mrlaozhou\Indulge\Entities\Value::class
    ],
];

Using

Model

Use trait "\mrlaozhou\laravel-indulge\Indulge" in you (Eloquent)Model.

ep: Model: App\Models\Leads

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Mrlaozhou\Indulge\Indulge;

class Leads extends Model
{
    use Indulge;
}

Seamless expansion .

Facade

IndulgeOption::trees($pid); // recursion IndulgeOption::lists($pid); // recursion IndulgeOption::roots(); // pid === 0 IndulgeOption::child($pid); // sub
Comments