gsferro/resource-crud-easy

Generic resource method for crud using SPA

dev-master 2023-06-24 08:11 UTC

This package is auto-updated.

Last update: 2024-10-24 10:58:23 UTC


README

Logo

Instalação:

composer require gsferro/resource-crud-easy -W

Pacotes Dependências:

Publish (TODO :install)

php artisan vendor:publish --provider="Gsferro\ResourceCrudEasy\Providers\ResourceCrudEasyServiceProvider" --force
php artisan vendor:publish --provider "OwenIt\Auditing\AuditingServiceProvider"
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
php artisan vendor:publish --provider="Gsferro\Select2Easy\Providers\Select2EasyServiceProvider" --force

Config front-end:

  • No Header html principal:
    {{-- jquery v3.6.4 (2023-03-08) --}}
    @ResourceCrudEasyJquery()
    {{-- opcional fontawesome v4 --}}
    @FontAwesomeV4()
    {{-- style ui css datatables --}}
    @ResourceCrudEasyDatatablesExtraCss() 
    {{-- style ui css --}}
    @ResourceCrudEasyStylesCss() 
    
    {{-- select2easy --}}
    @select2easyCss()
  • No Final Body html principal:
    {{-- plugin datatables js --}}
    @ResourceCrudEasyDatatablesPlugin()
    {{-- plugins js --}}
    @ResourceCrudEasyPlugins()
    {{-- select2easy --}}
    @select2easyJs()
    {{-- para o datatables poder utilizar via post --}}
    <script type="text/javascript">
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            async: true
        });
        $(function(){
            {{-- select2easy run --}}
            $('.select2easy:not(".select2-hidden-accessible")').select2easy();
        });
    </script>
    {{-- index utiliza  --}}
    @yield('js')

Uso:

  • Criar Crud Completo
php artisan gsferro:resource-crud <Nome-Entidade> {--table=} {--connection=} {--factory} {--seeder} {--migrate}
  • Criar Model
php artisan gsferro:resource-crud-model <Nome-Entidade> {--table=} {--connection=} {--factory} {--seeder} {--migrate}

Obs: