Download the PHP package laravel-admin/crud without Composer

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

CRUD models in Laravel

This package is experimental, don't use it for production.

Installation

Install from Packagist:

Add the service provider to your app.php config file

Usage

First create a migration, model and admin controller for your module. Add the admin controller as a resource to your routes, like:

Resource controller

Setup your basic controller for crud methods as follow:

The ResourceController includes all the crud methods for a Laravel resource controller, like index, create, store, edit, update and destroy. At this point only the show method will not be used.

The view who will be rendered by index,create and edit are default bootstrap and compatible with the views which will be scaffoled by artisan make:auth.

The only thing you have to do is defining your fields and validation. Herefore you can override a couple of methods of the parent controller in your own controller.

Validation on store

Defining your fields for the create form

Manipulate your payload for store

This method is optional, by default the payload will be the fields which are defined in the getFieldsForCreate method. If you want to manipulate your data, like a password or date format you can implement this method

Edit model

For editing your model, the same methods as store are available:

Note: If your settings for store and update are the same, you only have to define the methods for the update.

View your records

For generating the index view, you can define your fields with the getFieldsForList method.

Note: Each field has an optional formatter property. By default the property of the model defined in the id is shown. You can assign a accessor in the format field as string, or a callback as shown above.

More to come....

Layout module

This package includes a layout builder for your page.

Installation

Add the layout config file to your local config folder.

Add the Layout vue component to your view instance

Build your components

Within the config file you can build your own components. Default one simple component is included in the config.

Each component is a combination of fields. The type of fields are:

note: The selectbox field can have an options attribute, this can be an array or a callback.

Component drivers

Each component can have a custom driver when you need some extra logic before rendering it into a view.

Add a full namespaced class into the driver attribute of your component config to enable it.

The best practice is to extends the default component class:

The following methods can be extended or overwritten:

Field drivers

Also each field can have a custom driver, this can be useful when the content from the admin has to be formatted before sending it to the view.

The best practice is to extends the default field class:

You can add methods or overwrite the toString method.

Views

Create your view in the folder which is defined in the layout config (default 'layout'). The name of the template is the same of the id of your component, like 'basic-text.blade.php'.

Note: If you use your own driver, you van set a custom view within the method 'getView'.

Create your admin controller

Within your module add a LayoutController file like this:

Add the following route into your module routes:

If your layout is in the translatable table, the route will be:

If not, it will be:

Render the layout

Add the following trait to the model which has a layout field:

There a several ways to render your layout. The most easy solutions is to render it directly from your view file:

If you want to use blade includes:

If you want to have executed the logic in your controller:


All versions of crud with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.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 laravel-admin/crud contains the following files

Loading the files please wait ....