Download the PHP package rabibgalib/api-action without Composer
On this page you can find all versions of the php package rabibgalib/api-action. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rabibgalib/api-action
More information about rabibgalib/api-action
Files in rabibgalib/api-action
Package api-action
Short Description This packages will help to create APIs with Controller, Request, Traits, Model, Migration, Action Classes, Helper Class.
License MIT
Informations about the package api-action
Api Action Structure
app
└── ApiActionPackages
│ └── {{ActionName}}
│ │ └── Actions
│ │ │ ├── Create{{ActionName}}
│ │ │ ├── Delete{{ActionName}}
│ │ │ ├── Find{{ActionName}}
│ │ │ ├── List{{ActionName}}
│ │ │ └── Update{{ActionName}}
│ │ └── Helpers
│ │ └── {{ActionName}}Helper
│ └── BaseHelper
│ │ └── BaseHelper
│ └── Traits
│ └── ApiResponse
└── Http
│ └── Controllers
│ │ └── {{ActionName}}Controller
│ └── Requests
│ └── {{ActionName}}Request
└── Models
│ └── {{ActionName}}Model
└── database
└── migrations
└── create_{{ActionName}}_table
api-action
Installation
Configuration
Add the provider to your config/app.php
into provider
section if using lower version of laravel,
If you face 419 (page expired)
error or CORS
or XSRF
issue for a new project or have not fixed the issue,
then update App/Http/Middleware/VerifyCsrfToken.php
as -
Run Command
After the installation & configuration run the command as -
Example
If you want to create a Post action api. Please write command as -
This command will create
- an API PostController
- Action directory
- Action classes
- Helper classes
- Trait
- Form Request
- Model
- Migration
to perform a feature wise service for your application.
Now put below codes inside Post
Model as -
Now put below codes inside posts
Migration as -
After migration command, set up the routes/web.php as -
Now, you can test the APIs in Postman or Insomnia easily.