定制 goodyweb/jetstream-crud 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

goodyweb/jetstream-crud

Composer 安装命令:

composer require goodyweb/jetstream-crud

包简介

Create, Read, Update, and Delete for Jetstream

README 文档

README

Laravel logo Composer logo

Jetstream CRUD

This Laravel package generates bare Livewire Components and Blade templates that would allow you to manipulate the records of a certain database table. The modules include:

  • Create
  • Read
  • Update
  • Delete
  • Search
  • Pagination

Getting started

This package makes it easy to create a full CRUD module by just issuing a single command:

php artisan generate:crud --model=Person --livewire=Persons

Voila!

See the Installation, Configuration, and Usage sections for the full details.

Installation

composer require goodyweb/jetstream-crud dev-master

Configuration

On your Livewire configuration file (config/livewire.php), set the legacy_model_binding option to true like so:

'legacy_model_binding' => true,

Important: If you don't have the config/livewire.php file, you may just create one with the default content from the raw code repository.

Usage

  1. Make a database table as you usually would:

    php artisan make:migration create_persons_table --create=persons
    • Make some edits
        <?php
      
        use Illuminate\Database\Migrations\Migration;
        use Illuminate\Database\Schema\Blueprint;
        use Illuminate\Support\Facades\Schema;
      
        return new class extends Migration
        {
            /**
            * Run the migrations.
            */
            public function up(): void
            {
                Schema::create('persons', function (Blueprint $table) {
                    $table->id();
                    // add something columns here maybe
                    $table->timestamps();
                });
            }
      
            /**
            * Reverse the migrations.
            */
            public function down(): void
            {
                Schema::dropIfExists('persons');
            }
        };
    • Execute the actual creation of the table
      php artisan migrate
  2. Make the Eloquent Model for the database table as you usually would:

    php artisan make:model Person
  3. Generate the Livewire Component and Blade template for the CRUD module:

    php artisan generate:crud --model=Person --livewire=Persons
    Parameter Argument Explanation
    model Person Person refers to the Eloquent Model that will be used for the whole CRUD module.
    livewire Persons Persons refers to the class name of the Livewire that will be generated.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-12-10