theizerdev/larareact
Larareact is a Laravel package that streamlines adding React to Laravel applications, offering scaffolding, helpers, and sensible conventions so you can build modern single-page or hybrid frontends with less configuration and boilerplate.
whatsapp.view, whatsapp.manage, whatsapp.send, plus proveedores.send-carnet-whatsapp and productores.send-carnet-whatsapp. Without seeding, every integration route will 403 because the can() middleware will not resolve.
php artisan migrate
php artisan db:seed --class=PermissionSeeder
php artisan permission:cache-reset
Spatie\Permission\Models\Permission::findByName('whatsapp.send');
If the permission exists but is missing from the admin UI, the sector-mapping branch in PermissionSeeder.php is the first place to look.whatsapp.manage, open Integraciones → WhatsApp (/integrations/whatsapp), fill credentials, then hit /integrations/whatsapp/connect and poll /integrations/whatsapp/status. Once connected, send a PDF via /api/whatsapp/send-document with whatsapp.send.WhatsAppService.php (transport, MIME/size validation, error logging, JSON fallback), routes/modules/integration.php (route group + middleware), and README.md (now the source of truth for valid endpoints — note /api/whatsapp/send-image no longer exists).Always inject WhatsAppService, never call the HTTP client directly. The service encapsulates the multipart document field, MIME/size validation, structured error logging (HTTP status + response body), and the JSON fallback. If you bypass it you lose all of that.
Sending a carnet from a controller – permission-check the caller, then delegate:
Route::post('/proveedores/{proveedor}/carnet', [CarnetController::class, 'send'])
->middleware(['auth', 'verified', 'can:proveedores.send-carnet-whatsapp']);
Follow the naming convention for integration routes. The release standardises on name('integrations.whatsapp.*'), so route('integrations.whatsapp.status') etc. resolves. When adding a new endpoint, keep it inside the same Route::prefix('integrations/whatsapp')->name('integrations.whatsapp.') group so middleware and names stay consistent.
Two API endpoints, two intents:
/api/whatsapp/send – plain JSON text payload./api/whatsapp/send-document – multipart with document; use this for PDFs/images.Do not attempt to reuse /send with a file payload; the multipart path is a separate code path with its own fallback.
Credential lifecycle as a workflow. Treat connect/disconnect/reconnect/generate-token as an admin flow driven by the /status endpoint: generate token → update credentials → connect → poll status → disconnect/reconnect on failure. Wrap this in a UI component rather than scattering calls across views.
Leverage the permission granularity in views. Gate UI with @can('whatsapp.view') / @can('whatsapp.manage') and hide the send button behind @can('whatsapp.send'). This matches the route-level can() checks and keeps users from hitting dead-ending 403s.
document is the only accepted multipart field. The whole point of this release is that using anything else (e.g. file, image) fails. If you have legacy callers, patch them before deploying./api/whatsapp/send-image returns 404 by design. It was removed from the README as a non-existent endpoint. Search your front-end for any send-image references during the upgrade.php artisan permission:cache-reset (or clear the app cache) before deciding the middleware is misconfigured.whatsapp.* permission without extending the integraciones sector mapping means it will appear in a different admin group. Re-run the seeder after editing, and keep the mapping table in sync with new permission names.auth + verified. API consumers using tokens still need an email-verified user; test with a verified fixture or your smoke tests will 302/403 unexpectedly./integrations/whatsapp/... paths should be moved to route('integrations.whatsapp.*') — otherwise future renames will silently break the page.WhatsAppService rather than editing it in place, since the multipart/fallback logic is delicate and the release explicitly documents it for future maintainers.How can I help you explore Laravel packages today?