PHP code example of innoboxrr / larapack-generator
1. Go to this page and download the library: Download innoboxrr/larapack-generator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
innoboxrr / larapack-generator example snippets
public function isAdmin(): bool
{
return $this->id === 1;
}
// category_id: lo que sale solo. Borrar la categoría FALLA.
$table->foreignId('category_id')->constrained('categories')
->onUpdate('restrict')->onDelete('restrict');
// replaces_id: lo que se pidió. El producto se queda sin sustituto,
// no desaparece.
$table->foreignId('replaces_id')->nullable()->constrained('products')
->onUpdate('restrict')->onDelete('set null');
class Student extends Model
{
protected $table = 'academics_students';
}
php artisan larapack:full-model Post # dentro de una aplicación Laravel
php vendor/bin/builder larapack:full-model Post # binario, también fuera de Laravel
php vendor/bin/builder larapack:skill # -> .claude/skills/larapack/SKILL.md
php vendor/bin/builder larapack:skill --path=AGENTS.md # para agentes que leen AGENTS.md
php vendor/bin/builder larapack:skill --print # por salida estándar
php vendor/bin/builder larapack:validate # valida ./laraimport.json
php vendor/bin/builder larapack:validate ruta.json # valida el que le digas
php vendor/bin/builder larapack:validate --format=json # para la CI o un agente
php vendor/bin/builder larapack:validate --vue --react # también lo que necesitan las vistas
php vendor/bin/builder larapack:schema # imprime el esquema
php artisan larapack:model Post --dry-run # dice qué haría, sin escribir
php artisan larapack:model Post --force # regenera
php artisan larapack:model Post --format=json
php artisan larapack:verify
php artisan larapack:verify --strict # los avisos cuentan como fallos
php artisan larapack:verify --format=json
composer san migrate
php artisan route:json (innoboxrr/routes-to-json)
-> routes.json
-> setRoutes(routes) al arrancar el front
-> route('api.acme.catalogo.product.index')
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.