jatri/api-first-crud

There is no license information available for the latest version (dev-main) of this package.

A Laravel package to generate API-first CRUD operations

dev-main 2024-08-30 05:10 UTC

This package is auto-updated.

Last update: 2025-04-29 01:29:43 UTC


README

  • PHP: 7.4, 8.0, 8.1, 8.2, or 8.3
  • Laravel: 8.x, 9.x, 10.x, 11.x, 12.x

Installation

To install the package, run the following command:

composer require jatri/api-first-crud:dev-main

Usage

Once installed, you can generate a complete CRUD operation by using the following Artisan command:

php artisan make:crud Post

This will generate:

  • A model in app/Models/Post.php
  • A controller in app/Http/Controllers/PostController.php
  • A request validation file in app/Http/Requests/PostRequest.php
  • A migration file in database/migrations/xxxx_xx_xx_create_posts_table.php
  • API routes in routes/api.php

Troubleshooting

Common Issues

  • Missing Cache Table: If you encounter an error related to the cache table not existing, try the following commands:
php artisan cache:table
php artisan migrate
  • Class Not Found Errors: If you encounter related issues try the following command
composer dump-autoload