Download the PHP package mohammedhassan/crud-package without Composer

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

Laravel CRUD Generator Command

This package provides an Artisan command make:crud to quickly scaffold a complete CRUD (Create, Read, Update, Delete) module for your Laravel application. It generates a Model, Migration, Controller, Service, DTOs, and an API Resource, following a structured and scalable pattern.

Features

Installation

You can install the package via composer:

The package will automatically register its service provider. The necessary dependency wendelladriel/laravel-validated-dto will be installed automatically.

Usage

To generate a new CRUD module, use the following Artisan command:

Arguments

Options

Basic Example

This command will generate the CRUD files for a "Product" resource.

Advanced Example with Schema

This command will generate the CRUD files for a "Post" resource, using a schema definition for validation and migration fields.

What It Generates

The make:crud command creates the following files and components:

  1. Model: app/Models/{Name}.php

    • Includes standard Eloquent setup.
    • Adds helper methods for CRUD operations (store{Name}, update{Name}, etc.).
  2. Migration: database/migrations/..._create_{name_plural}_table.php

    • Creates the database table for the model.
    • If a --schema is provided, it automatically adds the columns to the migration file.
  3. Controller: app/Http/Controllers/{Name}Controller.php

    • A standard RESTful controller with index, store, update, and destroy methods.
    • Uses the generated Service and DTOs for handling requests.
  4. Service: app/Services/{Name}Service.php

    • Contains the business logic for the CRUD operations, keeping the controller thin.
  5. DTOs (Data Transfer Objects): app/DTOs/Service/{Name}/

    • Store{Name}DTO.php: For validating store requests.
    • Update{Name}DTO.php: For validating update requests.
    • Delete{Name}DTO.php: For validating delete requests.
    • List{Name}DTO.php: For handling listing/pagination parameters.
  6. API Resource: app/Http/Resources/{Name}Resource.php

    • For transforming the model into a JSON response.
  7. Route:

    • Appends an apiResource route to your API routes file (e.g., routes/api.php).
  8. Response Helper: app/Helpers/ResponsesHelper.php
    • A helper class for generating standardized JSON API responses. This is only created if it doesn't already exist.

The Schema File

The schema file allows you to define the fields for your model. It should be a PHP file that returns an array where keys are the field names and values are their Laravel validation rules. The command uses these rules to generate DTOs and migration columns.

Example Schema: app/Schemas/PostSchema.php

The command will look for the key that matches the model name (e.g., Post).

Customization

Author

This CRUD generator was created by Mohammed Hassan.


All versions of crud-package with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.2
laravel/framework Version ^10.10
laravel/sanctum Version ^3.3
laravel/tinker Version ^2.8
wendelladriel/laravel-validated-dto Version ^3.10
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 mohammedhassan/crud-package contains the following files

Loading the files please wait ...