Quickstart Guide
Get up and running with Cubeta Starter in under 5 minutes.
Prerequisites
- PHP 8.3+
- Laravel 13+
- Composer
Installation
Install the package via Composer:
composer require cubeta/cubeta-starterSetup
Choose your stack and run the installer:
For API Development
php artisan cubeta:install apiThis installs:
- API route structure
- Base classes (Repository, Service, Resource, ApiResponse)
- Middleware for localization
- Helper functions
For Web Development (Blade)
php artisan cubeta:install webOr for React + TypeScript with Inertia.js:
php artisan cubeta:install react-ts
php artisan cubeta:install react-ts-packagesOptional: Authentication & Permissions
php artisan cubeta:install auth
php artisan cubeta:install permissionsGenerate Your First Model
The fastest way to see Cubeta Starter in action is to generate a complete CRUD resource:
php artisan create:model ProductFollow the interactive prompts to define your model attributes. For example:
name:string
description:text
price:double
stock:integer
is_available:booleanThis single command generates:
- ✅ Model class with casts, searchable arrays, and scopes
- ✅ Migration file
- ✅ Factory with realistic fake data
- ✅ Seeder
- ✅ Repository with filtering, search, and pagination
- ✅ Service layer for business logic
- ✅ API Controller with index/show/store/update/destroy
- ✅ Form Request with validation rules
- ✅ JSON Resource for API responses
- ✅ Feature test suite
- ✅ API routes (registered in
routes/v1/api/) - ✅ Postman collection (optional)
Run Migrations and Seed Data
php artisan migrate
php artisan db:seed ProductSeederTest Your API
Start your development server:
php artisan serveTest the generated endpoints:
# List products (with pagination, search, filtering)
GET http://localhost:8000/api/v1/products
# Show a product
GET http://localhost:8000/api/v1/products/1
# Create a product
POST http://localhost:8000/api/v1/products
Content-Type: application/json
{
"name": "Laptop",
"description": "High-performance laptop",
"price": 999.99,
"stock": 50,
"is_available": true
}
# Update a product
PUT http://localhost:8000/api/v1/products/1
# Delete a product
DELETE http://localhost:8000/api/v1/products/1Next Steps
Now that you have a working CRUD resource, explore:
- Configuration — Customize paths, namespaces, and locales
- Usage Guide — Learn all the options for
create:modeland other commands - BaseRepository — Built-in filtering, search, and query methods
- ApiResponse — Standardized JSON response formatting
- Testing — Write and extend feature tests
- Permissions — Role-based access control
Tips for Success
TIP
Track your changes with Git — Cubeta Starter generates many files at once. Commit before generating and review the diff after.
TIP
Customize after generation — The generated files are a starting point. Review and adjust validation rules, factory data, and test cases to match your domain.
TIP
Use the interactive prompts — The package asks intelligent questions. For example, it auto-detects foreign keys from _id suffixes and suggests relationships.
NOTE
After the first generation, a cubeta-starter.config.json file is created at your project root. This tracks your generated tables and settings — keep it under version control and avoid editing it by hand.
