Download the PHP package tots/laravel-crud-generator without Composer

On this page you can find all versions of the php package tots/laravel-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 laravel-crud-generator

TOTS Laravel CRUD Generator

[![Latest Version on Packagist](https://img.shields.io/packagist/v/tots/laravel-crud-generator.svg?style=flat-square)](https://packagist.org/packages/tots/laravel-crud-generator) [![Total Downloads](https://img.shields.io/packagist/dt/tots/laravel-crud-generator?style=flat-square)](https://packagist.org/packages/tots/laravel-crud-generator) TOTS Laravel CRUD Generator is a library to automate the creation of files for Laravel APIs

Installation

  1. To install the package run

  2. Add "TOTS\LaravelCrudGenerator\LaravelCrudGeneratorServiceProvider::class," as a package service provider in your config/app.php file
  3. To generate package config files run

  4. Update json file called "laravel-crud-generator.json" with all the things that you need
  5. To generate all the files for the definitions given at laravel-crud-generator.json file run

General configuration

Inside config folder you will find a file called "laravelCrudGenerator.php". There you can modify the default behavor of the generator. Here you have a table with all the attributes you can modify:

Attribute Description Type Example
default_file_path Indicates the path to json file string
rewrite Indicates if files are allowed to be rewritten if the generator runs boolean
files Indicates what type of files the generator is allowed to generate. All types of file are listed in the example. array
relations Indicates the default relationships of the files generated. This is in case you need to stablish a relationship by default for all files. array of relations
routes Indicates the default configuration for routes files array
model Indicates the default configuration for model files array
controller Indicates the default configuration for controller files array
request Indicates the default configuration for request files array
resource Indicates the default configuration for resource files array
service Indicates the default configuration for service files array
migration Indicates the default configuration for migration files array
factory Indicates the default configuration for factory files array
mock Indicates the default configuration for mock seeder files array
test Indicates the default configuration for test files array

Configuration of laravel-crud-generator.json

As you may see, this file comes with an example. The hierarchy of the file is this:

Entity

Enetity general configuration attributes

File

File attributes configuration


General Attributes

Attribute Description Type Example
nameSingular Indicates the singular name of the entity string (optional)
namePlural Indicates the plural name of the entity string (optional)
rewrite Indicates if the files of the entity should be rewritten boolean (optional)
files Indicates what files of the entity should be created array (optional)
attributes Indicates the attributes of the entity object of objects (optional)
relations Indicates the relationships of the entity object of objects (optional)
files Indicates what files of the entity should be created array (optional)
routes Indicates the attributes for routes file of the entity object (optional) --
model Indicates the attributes for model file of the entity object (optional) --
controller Indicates the attributes for controller file of the entity object (optional) --
request Indicates the attributes for request file of the entity object (optional) --
resource Indicates the attributes for resource file of the entity object (optional) --
service Indicates the attributes for service file of the entity object (optional) --
migration Indicates the attributes for migration file of the entity object (optional) --
factory Indicates the attributes for factory file of the entity object (optional) --
mock Indicates the attributes for mock seeder file of the entity object (optional) --
test Indicates the attributes for test file of the entity object (optional) --

Type of Files

Right now, there are 10 types of files that can be generated:

Routes

Attribute Description Type Example
filePath Indicates the path of the file string (optional)
use Indicates the traits that should be included in this file array of strings (optional)
rewrite Indicates if the file should be rewritted if exist boolean (optional)

Model

Attribute Description Type Example
filePath Indicates the path of the file string (optional)
namespace Indicates the namespace of the class string (optional)
classname Indicates the name of the class string (optional)
table Indicates the table of the model string (optional)
primaryKey Indicates the primary key of the model string (optional)
traits Indicates the traits that should be implemented in this class array of strings (optional)
use Indicates the traits that should be included in this class array of strings (optional)
interfaces Indicates the interfaces that should implement this class array of strings (optional)
extends Indicates the path of the extended class string (optional)
rewrite Indicates if the file should be rewritted if exist boolean (optional)

Controller

Attribute Description Type Example
filePath Indicates the path of the file string (optional)
namespace Indicates the namespace of the class string (optional)
classname Indicates the name of the class string (optional)
traits Indicates the traits that should be implemented in this class array of strings (optional)
use Indicates the traits that should be included in this class array of strings (optional)
interfaces Indicates the interfaces that should implement this class array of strings (optional)
extends Indicates the path of the extended class string (optional)
rewrite Indicates if the file should be rewritted if exist boolean (optional)
methods Indicates the methods that should be implemented in this controller. You can add cannonical methods (list, store, show, update, delete, restore) or your own custom methods. array of strings (optional)

Usage

To generate files is neccesary to config the laravel-crud-generator.json file and then run "php artisan crud:generate" command.


All versions of laravel-crud-generator with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
laravel/framework Version >=9.0
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 tots/laravel-crud-generator contains the following files

Loading the files please wait ....