Download the PHP package cerebralfart/laravel-crud-controller without Composer

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

Laravel CRUD

An easy way to do your CRUD stuff

Registering routes

The CRUD controller works as a RESTful resource controller, so you can use the following one-liner to register a controller.

This will register the following routes:

Verb Path Action Name
GET /users index users.index
GET /users/create create users.create
POST /users store users.store
GET /users/{user} show users.show
GET /users/{user}/edit edit users.edit
PUT /users/{user} update users.update
DELETE /users/{user} destroy users.destroy

If you only need some of these routes, you can use ->only:

General configuration

Optional configuration

Disabling authentication

While not recommended, it is possible to disable the authorization. This can be done at the controller-level by setting the $authDisabled property to true, or by passing an array of actions on which it should be disabled.

Customizing authorization error messages

The CRUDController provides default error messages for all routes, but these can be overridden if you want to provide more specific errors. The easiest way to do so is via the $authErrors property on the controller.

Alternatively, if you require more fine-grained control of the error message displayed, we recommend customizing this in the policy class.

List models

Filtering

There are two ways to define filters in the CRUDController. All filters are defined as functions, but their interpretation depends on the argument it allows. Filtering on database level can be done by accepting a Builder instance, like the filterDraft below. You can apply any where-clause you'd like to. Alternatively, you can filter items once they are retrieved from the database, where you can interact with your models as you normally would. See the filterHot option below.

To activate one or more filters, simply pass their names to the _filter property in your request. The controller can accept multiple filters simultaneously, in which case they are applied in an AND-like manner. A default set of filters can be defined using the defaultFilters property on the controller. Should you want to invert a filter, e.g. retrieve all non-draft items, you can prefix the filter name in the request with an exclamation mark: _filter=!draft


All versions of laravel-crud-controller with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^9.0|^10.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 cerebralfart/laravel-crud-controller contains the following files

Loading the files please wait ....