Download the PHP package digitaldream/laracrud without Composer

On this page you can find all versions of the php package digitaldream/laracrud. 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 laracrud

Laravel Code Generator

Do you have a well structed database and you want to make a Laravel Application on top of it. By using this tools you can generate Models which have necessary methods and property, Request class with rules, generate route from controllers method and its parameter and full features form with validation error message and more with a single line of command. So lets start. See demo code and slides

Installation

Setting

  1. Add this line to config/app.php providers array . Not needed if you are using laravel 5.5 or greater

  2. Then Run

Commands

Then you can see new commands by running 'php artisan'

N.B: --api option will generate api resource. Like Controller, Request, Route, Test. Dingo API compatible code will be generated . See API documentation

How to Use

Create a Model

There are some good practice for model in Laravel. Use scope to define query, define fillable, dates, casts etc. Also define relation, setAttribute and getAttribute for doing work before and after model save and fetch.

We are going to create this thing automatically by reading table structure and its relation to others table.

By default Model Name will be based on Table name. But Model name can be specified as second parameter. Like below

Video Tutorial

Create Request

A well structured table validate everything before inserting . You can not insert a illegal date in a birth_date column if its data type set to date.So if we have this logic set on table why we should write it on Request again. Lets use this table logic to create a request class in laravel.

php artisan laracrud:request MyUser

Here MyUser is Eloquent Model. From LaraCrud version 4.* this command accept Model Name instead of Table

Like Model Name we can also specify a custom request name.

Also If you like to create multiple request for your resourceful controller then

It will create a folder users on app/Http/Requests folder and create these request classes. Sometimes you may like to create individual request class for each of your controller method then.

It will read your controller and create request classes for your Public method

video tutorial

Create Controller

This will create a controller which have create, edit, save and delete method with codes . It also handle your relation syncronization

video tutorial

Create View

A typical form represent a database table. E.g. for a Registration form it has all the input field which is necessary for users table. Most of the time we use Bootstrap to generate a form . It has error field highlighting if validation fails. Also display value. This all can be done by

Here User is Eloquent Model. From LaraCrud version 4.* this command accept Model Name instead of Table

This will create a complete users crud view.

video tutorial

Create Route

Routes are the most vital part of a laravel application. WE create routes by its public methods and parameter. Lets do this work to rotue command.

If you have some routes already redine for then do not worry. It will create routes for which does not define yet. Please use forward slash(/) for sub namespace. For example,

Policy

Laravel have default policy generator. It works like same with one extra feature that is create policy method based on controller public methods.

Package

Packages gives us opportunity to create/use components into our existing application. That make our code reusable. Laravel package has similar structure as a Laravel application has.

This will create a folder same structure as a Laravel application has into your /packages folder See Package documentation Video tutorial

Test

We need to test our routes endpoints. To create test class based on a controller do the following

Transformer

Transformer are a vital part of Dingo API. To expose a model to api endpoint Transformer play media between api and model.

See API documentation

Create everything at once

If we need all the command to then just to

It will create Model, Request, Controller, View. Then you just need to run route command to create routes.

Migration

Somethings we may need to create a migration file from a table. Then this command will be useful. It will generate all the necessary code for your migration files. So your migration file is ready to use.

Customize Code Template

Coding Style differ from developer to developer. So you can control how your code will be generated. Code templates are organized by folder in resources/vendor/laracrud/templates . Go there and change the style. After that your code will be generated by reading these files. Please do not remove or change @@placeHolder@@. This will be replaced by application.

NB: only for mysql database

It is recommended to take a look in the generated file before use it.

Like my work? If so hire me on upwork


All versions of laracrud with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^8.0
digitaldream/dbreader Version ~1.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 digitaldream/laracrud contains the following files

Loading the files please wait ....