Download the PHP package kha333n/crudmodule without Composer

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

Laravel CRUD Module

This is a simple CRUD module for Laravel. It is a simple module that can be used to create, read, update, and delete records in a database.

It will help you implement basic CRUD operations in Laravel with faster speed and better efficiency.

Don't waste your time on repetitive basic tasks

It is extensible and customizable to fit your needs

Features

Index

Installation

You can install the package via composer:

Usage

Add Crudable trait and implement CrudableInterface in your model. And Implement required crudable methods in your model.

Using via API routes

For most of the usage you can use it via built-in API routes They provide full CRUD operations

API Routes Available:

Example: Using Book model

Listing Customizations

You can customize listing records by passing query parameters in url

Available query parameters:

Example: Using Book model

GET /api/book?withTrashed=true&paginate=true&perPage=23

Filtering & Sorting

You can filter and sort records bypassing query parameters in url We are using Spatie Laravel Query Builder for this see Spatie guide for more details

Example: Using Book model

GET /api/book?filter[title]=abc&sort=created_at

Using via Controller

In case you want greater control over CRUD or want customized application flow, you can directly interact with the model repository.

Adding validation rules

In your model, you can add validation rules for each column.

If not provided, it will use default validation rules based on its cast.

If both are not defined, it will treat it as a string.

Default Rules:

Adding Authorization rules

In your model, you can add authorization rule for each column

implement CrudableInterface in your model

Implement all required methods in your model and in each method, add your authorization logic

Available method:

In case you require only a few of them. Use CrudableAdapter trait in your model and then only add required ones. All others will be allowed by default.

Example:

Filtering & Sorting

For filtering and sorting we are using Spatie Laravel Query Builder package.

By default, it will allow all fillable columns for both filtering and sorting

If you want to modify them or add own filtering rules, implement filters OR sorts method in your model

Listing Customization

By default all function returns all records in model. But you can customize them by passing CurdConfiguration class to it with custom configuration.

Configurations Available

Example:

Extending Functionality

Functionality of CRUD can be extended by 2 methods

  1. Using Observers If you need to add additional data, modify or change data while some operation is on going use Observers on your model. Like while creating a book via CRUD you want to add a generated book_slug to it. You can use observer for it.
  2. Using Events If you need to perform some additional tasks after some operation is done. Like sending an email after creating a book. You can use events for it. Events available:
    • Created
    • Updated
    • Deleted
    • ForceDeleted
    • Restored

Example: On Book model register event listeners in EventsServiceProvider like this

License

MIT License. Please see the License File for more information.

Contributing

Please see CONTRIBUTING.md for details.

About kha333n

kha333n is a web developer and open-source contributor.


All versions of crudmodule with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-query-builder Version ^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 kha333n/crudmodule contains the following files

Loading the files please wait ....