Download the PHP package ashique-ar/laravel-crud-generator without Composer

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

Laravel CRUD Generator

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A powerful, configuration-driven CRUD API generator for Laravel applications. Generate complete REST APIs with advanced features like permissions, filtering, sorting, validation, relations management, and custom business logic handlers - all through simple configuration.

✨ Features

πŸ“‹ Requirements

πŸ“¦ Installation

Install the package via Composer:

Run the installation command:

This will:

πŸš€ Quick Start

1. Generate Your First Resource

Use the artisan command to quickly scaffold a new resource:

2. Configure Relations (New!)

Add relations to enable dynamic form management:

3. Example Resource Configuration

Here's a complete example of a resource with relations in config/crud.php:

4. Register API Routes

Add to your routes/api.php or service provider:

Your API endpoints will be available at:

πŸ› οΈ Artisan Commands

Resource Management

Options:

Relations Management

Options:

Custom Logic

Permissions

Installation & Setup

πŸ”— Relationships Configuration

The relationships system allows you to create dynamic forms with dependent dropdowns and complex relationships. This unified approach handles both Laravel Eloquent relationships and form field relationships in one configuration.

Relationship Types

  1. Single Select - For foreign key relationships (belongs to)
  2. Multiple Select - For many-to-many relationships (coming soon)
  3. Dependent Dropdowns - Where one field depends on another

Relationship Configuration Structure

Real-World Examples

Vehicle Management System

Blog Post with Tags

Frontend Integration

Your dynamic frontend can read these configurations and automatically:

  1. Generate appropriate form controls based on relationship configuration
  2. Fetch options from the appropriate endpoints (/api/crud/{entity})
  3. Handle dependent dropdowns by watching parent field changes
  4. Support search functionality in dropdowns
  5. Validate required/optional fields
  6. Display appropriate fields in tables and lists

Example frontend usage:

πŸ“Š API Endpoints

All resources automatically get the following endpoints:

Standard CRUD Operations

Method Endpoint Description
GET /api/v1/{resource} List all items with pagination, filtering, sorting
POST /api/v1/{resource} Create a new item
GET /api/v1/{resource}/{id} Get a specific item
PUT /api/v1/{resource}/{id} Update an item
DELETE /api/v1/{resource}/{id} Delete an item

Additional Endpoints

Method Endpoint Description
GET /api/v1/{resource}/config Get resource configuration (including relations)
GET /api/v1/{resource}/docs API documentation for this resource
POST /api/v1/{resource}/bulk Bulk operations (delete, update)
POST /api/v1/{resource}/{id}/restore Restore soft-deleted item

Query Parameters

Pagination

Search

Sorting

Filtering

Including Relations

βš™οΈ Configuration Options

Global Configuration

Edit config/crud.php to customize global settings:

Resource Configuration Options

Each resource supports these configuration options:

πŸ“– Available Endpoints

For each configured resource, the following endpoints are automatically generated:

Method Endpoint Description
GET /api/v1/{resource} List resources with pagination, search, and sorting
POST /api/v1/{resource} Create a new resource
GET /api/v1/{resource}/{id} Get a specific resource
PUT/PATCH /api/v1/{resource}/{id} Update a resource
DELETE /api/v1/{resource}/{id} Delete a resource
POST /api/v1/{resource}/bulk Bulk operations (if enabled)
GET /api/v1/{resource}/trashed List soft-deleted resources (if enabled)
POST /api/v1/{resource}/{id}/restore Restore soft-deleted resource (if enabled)
DELETE /api/v1/{resource}/{id}/force Force delete resource (if enabled)
GET /api/v1/{resource}/docs API documentation for the resource

Query Parameters

Pagination

Search

Sorting

Filtering

πŸ”§ Advanced Usage

Model Namespacing

The package supports flexible model namespacing to accommodate different project structures:

When using artisan commands, you can specify models in several ways:

Custom Logic Handlers

Create custom business logic for your resources:

This generates:

Then update your configuration:

Adding New Resources

Use the artisan command to quickly add new resources:

This will interactively help you configure:

Bulk Operations

Perform operations on multiple resources:

Permissions

The package integrates seamlessly with Spatie Laravel Permission:

API Documentation

Access auto-generated documentation:

Returns OpenAPI 3.0 compatible JSON that can be used with Swagger UI or similar tools.

πŸ“ Configuration

The package uses a comprehensive configuration system in config/crud.php. Here's a complete reference:

Global Configuration

πŸ§ͺ Testing

The package includes comprehensive tests. Run them using:

Example Test

πŸ”’ Security

Permission Middleware

The package includes built-in permission checking:

This checks for permissions like:

Validation

All requests are automatically validated using the rules defined in your configuration:

Use {{id}} in update rules to exclude the current record from unique checks.

Mass Assignment Protection

Only fields defined in fillable arrays are allowed for mass assignment, providing protection against mass assignment vulnerabilities.

πŸ“š Examples

Complete Vehicle Management System

See examples/vehicle-crud-config.php for a complete example of a vehicle management system with:

Blog System

🀝 Contributing

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

Development Setup

πŸ“„ License

The MIT License (MIT). Please see License File for more information.

πŸ†˜ Support

πŸ—ΊοΈ Roadmap


Made with ❀️ by Ashique AR ], ],

// Resource definitions
'resources' => [
    // Your resources here...
]

]; bash composer test bash composer test-coverage



## πŸ“ Configuration

See the [Configuration Guide](docs/configuration.md) for detailed configuration options.

## πŸ”„ Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## 🀝 Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## πŸ”’ Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## πŸ“„ License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## πŸ™ Credits

- [Your Name](https://github.com/ashique-ar)
- [All Contributors](../../contributors)

## πŸ’‘ Support

- [Documentation](https://github.com/ashique-ar/laravel-crud-generator#documentation)
- [Issues](https://github.com/ashique-ar/laravel-crud-generator/issues)
- [Discussions](https://github.com/ashique-ar/laravel-crud-generator/discussions)

---

Made with ❀️ for the Laravel community

All versions of laravel-crud-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^11.0|^12.0
spatie/laravel-permission Version ^5.0|^6.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 ashique-ar/laravel-crud-generator contains the following files

Loading the files please wait ....