Download the PHP package zekini/livewire-crud-generator without Composer

On this page you can find all versions of the php package zekini/livewire-crud-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package livewire-crud-generator

Introduction

The zekini/livewire-crud-generator package allows us to generate an admin panel and generate crud for applications

Installation

composer require --dev zekini/livewire-crud-generator

Usage

To scaffold admin ui and authentication php artisan admin:scaffold

To run the created migrations php artisan migrate

To generate a super admin php artisan admin:superuser ensure user class uses the HasRoles spatie trait

To generate crud for default package tables php artisan admin:crud:package-tables

To setup relationship mappings on a model simply go to the zekini-admin config under relationships To generate crud for a particular model. Simply create the migration file for that crud and migrate to the database

After the you simply run admin:crud generate command wth the table name

php artisan admin:crud:generate tablename This will generate all views, routes, factories, controllers, permissions, requests, unit test, models need to crud this application

Relationships

For tables with foreign keys ensure to update the relationships array of the zekini config file

Eg for a post relationship belonging to users. where record title is the record you want to show from the foreign table

'posts'=> [
    [
    'name' => 'belongs_to',
    'table'=> 'users',
    'record_title'=> 'name'
    ]
]

Images and Files

By default when a table has column name of image or file the traits for file upload will automatically be generated and added but incase where your column name is an image and is not named in that manner you can do the following to process image uploads. In your edit and create components use Livewire\WithFileUploads;

Add this line just before the line that creates the model

`$this->column_name = $this->getFile($this->column_name)`

For edit components you simply check if the first element of that array is a TemporaryUploadedFile

`if($this->column_name[0] instanceof TemporaryUploadedFile) {
$this->column_name = $this->getFile($this->column_name);
$this->deleteFile($this->$modelClass->column_name); // delete old image
}`

In your list component change the column to a callback to display an image

`Column::callback(['column_name'], function ($column_name) {
    return view('zekini/livewire-crud-generator::datatable.image-display', ['file' => $column_name]);
})->unsortable()->excludeFromExport(),`

In your form.blade.php for the model simply add the input type as file and multiple on it.

For your unit test replace the column values for a fake uploaded file in an array as files are threated as multiple uploads for a model [\Illuminate\Http\UploadedFile::fake()->image('file.jpg')] and also in your factories replace image column value with an array '["file.jpeg"]'

Laravel Jetstream

With the integration of laravel jetstream, ensure you run the following commands npm install npm run dev

Landing Page

In other to force delete the current landing page run php artisan vendor:publish --tags=views --force

Options

You can use this additional arguments with crud generator command to customize what components gets generated php artisan admin:crud:generate --only=component-datatable The above will generate only the datatable component

php artisan admin:crud:generate --exclude=model The above will generate all other components except the model

php artisan admin:crud:generate --readonly The above will generate all components with a readonly datatable

A full list of keys is given below

        'model' => 'Model Component',
        'route' => 'Route and Sidebar',
        'form' => 'Generate Form',
        'view-index' => 'Livewire Index view',
        'component-datatable' => 'Livewire datatable component',
        'component-index' => 'Livewire index component',
        'permission' => 'Generate Permissions',
        'test-datatable' => 'Datatable Test',
        'test-index' => 'Index Component Test',
        'factory' => 'Factory class'

Note

You are required to add a custom middleware to redirect to admin or users based on the role of the given user

Dependency Issues

if you encounter any dependeny issues when installing package delete composer.lock file and require the package


All versions of livewire-crud-generator with dependencies

PHP Build Version
Package Version
Requires zekini/laravel-generics Version ^2.0.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zekini/livewire-crud-generator contains the following files

Loading the files please wait ...