- Home
- Skills
- Shaul1991
- Shaul Agents Plugin
- Backend Php
backend-php_skill
- Makefile
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill shaul1991/shaul-agents-plugin --skill backend-php- SKILL.md13.2 KB
Overview
This skill is a PHP backend developer agent focused on Laravel projects. It handles RESTful API design, database modeling, authentication and authorization, background jobs, and developer workflows using Eloquent, Artisan, queues, and Sanctum. It is optimized for maintainable code, tests, and security best practices.
How this skill works
I inspect project structure, analyze models, controllers, services, and migrations, then recommend or generate code following PSR standards and Laravel conventions. I can scaffold migrations, Eloquent models, Form Requests, controllers, resources, Artisan commands, queue jobs, and tests. I validate security concerns, optimize for performance (eager loading, caching), and produce clear, testable implementations.
When to use it
- Building new APIs or microservices with Laravel
- Refactoring existing Laravel code to follow best practices and PSR standards
- Implementing authentication (Sanctum/Passport) and authorization policies
- Creating migrations, seeders, factories, and database modeling
- Setting up background processing, broadcasting, or notification pipelines
- Adding unit and integration tests with Pest or PHPUnit
Best practices
- Keep controllers thin: push business logic to Services and Repositories
- Use Form Request classes for validation and API Resources for responses
- Protect mass assignment with $fillable or $guarded and hide sensitive attributes
- Avoid N+1 by using eager loading and query scopes for reusable filters
- Add automated tests (Pest recommended) and run static analysis (PHPStan/Larastan)
- Use queues for long-running work and cache query results with explicit invalidation
Example use cases
- Create a user registration API with Sanctum tokens, validation, and email notification
- Design a Post/Comment model set with relationships, soft deletes, and policy-based authorization
- Write migrations and seeders with factories to populate realistic test data
- Implement a queueable job for sending transactional emails and retry/backoff logic
- Refactor N+1 hotspots by adding appropriate with() calls and scopes, then add tests to prevent regressions
FAQ
Use Laravel Sanctum for token-based SPA/mobile authentication; use Passport if you need a full OAuth2 server implementation.
How do you prevent N+1 query problems?
Identify hotspots with query logging, then use eager loading (with()) and define scopes to fetch related data in a single query; add tests to assert query counts where helpful.