Download the PHP package dev-toolbelt/laravel-fast-crud without Composer

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

Laravel Fast CRUD

CI Coverage Latest Stable Version Total Downloads License PHP Version

A powerful Laravel package for rapid CRUD API scaffolding. Build complete RESTful APIs in minutes with minimal boilerplate, following best practices and the JSend specification.

Features

Requirements

Installation

Publish the configuration (optional):

Quick Start

1. Create a Controller

2. Register Routes

That's it! You now have a complete CRUD API.

Available Actions

Action Method Route Permission Description
Search GET /products {module}.access.search List with filtering, sorting, pagination
Create POST /products {module}.access.create Create a new record
Read GET /products/{id} {module}.access.view Get a single record
Update PUT/PATCH /products/{id} {module}.access.update Update a record
Delete DELETE /products/{id} {module}.access.delete Permanently delete a record
Soft Delete DELETE /products/{id}/soft {module}.access.delete Soft delete with audit
Restore PATCH/PUT /products/{id}/restore {module}.access.restore Restore a soft deleted record
Options GET /products/options none Label-value pairs for HTML selects
Export CSV GET /products/export-csv {module}.access.exportCsv Export filtered data to CSV

Note: The Options route (GET /options) has no permission middleware and is always publicly accessible (subject to any other middleware applied to the surrounding route group). This makes it easy to populate HTML <select> fields and dropdowns without requiring the user to have explicit permissions.

Search Operators

Filter your data with powerful operators via query string:

Operator Description Example
eq Equals filter[status][eq]=active
neq Not equals filter[status][neq]=deleted
like Contains (ILIKE %value%) filter[name][like]=phone
in In list filter[status][in]=a,b,c
nin Not in list filter[status][nin]=x,y
gt Greater than filter[price][gt]=100
gte Greater than or equal filter[price][gte]=100
lt Less than filter[price][lt]=500
lte Less than or equal filter[price][lte]=500
btw Between (dates or numbers) filter[created_at][btw]=2024-01-01,2024-12-31
gtn Greater than or NULL filter[stock][gtn]=10
ltn Less than or NULL filter[stock][ltn]=5
nn Not null filter[deleted_at][nn]=1
json JSON contains filter[tags][json]=electronics

Term Search

In addition to operator-based filters, Search supports a configurable term filter that matches multiple fields using LIKE (MySQL/SQLite) or ILIKE (PostgreSQL).

Usage

Controller Configuration

Query Generated (Example)

For PostgreSQL, filter[term]=john with the fields above generates a query equivalent to:

Custom Term Key

Sorting

Sort by one or multiple fields (prefix with - for descending):

Pagination

Available Hooks

Customize behavior by overriding hooks in your controller:

Action Available Hooks
Create createValidateRules(), beforeCreateFill(), beforeCreate(), afterCreate()
Read modifyReadQuery(), afterRead()
Update updateValidateRules(), modifyUpdateQuery(), beforeUpdateFill(), beforeUpdate(), afterUpdate()
Delete modifyDeleteQuery(), beforeDelete(), afterDelete()
Soft Delete modifySoftDeleteQuery(), beforeSoftDelete(), afterSoftDelete(), getSoftDeleteUserId()
Restore modifyRestoreQuery(), beforeRestore(), afterRestore()
Search modifySearchQuery(), modifyFilters(), afterSearch()
Options modifyOptionsQuery(), afterOptions()
Export CSV modifyExportCsvQuery()

Hook Examples

Validation

The package provides built-in validation using Laravel's validation system. Define rules by overriding createValidateRules() or updateValidateRules() methods.

Validation Error Response

When validation fails, a 400 response is returned with detailed error information:

Each error includes:

For detailed validation documentation, see:

Configuration

Configurable HTTP Status Codes

Each action supports a configurable http_status option to customize the HTTP status code returned on successful responses:

Validation Error HTTP Status

All validation errors (empty payload, invalid UUID, required field, column not found) use the global.validation.http_status configuration:

To return a different status code for validation errors:

Available status codes are defined in the DevToolbelt\Enums\Http\HttpStatusCode enum.

Selective Route Registration

Include or exclude specific actions:

CSV Export

Configure CSV export with custom columns and nested relationships:

API Response Format

All responses follow the JSend specification:

Success Response:

Success with Pagination:

Fail Response (client error):

Empty Payload Error:

Invalid UUID Error:

Documentation

Detailed documentation for each component:

Core:

Actions:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

Code Quality Requirements

Check Tool Requirement
Tests PHPUnit All tests must pass
Coverage PCOV Minimum 85% coverage
Code Style PHP CodeSniffer PSR-12 compliant
Static Analysis PHPStan Level 6, no errors

Pull Request Guidelines

Before submitting a PR, ensure:

  1. All tests pass: composer test
  2. Coverage is at least 85%: composer test:coverage
  3. Code style is correct: composer phpcs
  4. No static analysis errors: composer phpstan

Important: Pull requests with coverage below 85% will be automatically blocked by CI.

Coverage Report

License

MIT License. See LICENSE for details.


All versions of laravel-fast-crud with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
dev-toolbelt/jsend-payload Version ^1.0
dev-toolbelt/enums Version ^1.0
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 dev-toolbelt/laravel-fast-crud contains the following files

Loading the files please wait ...