hadyfayed/laravel-agent/auth-setup

Claude Code and agent skill by hadyfayed/laravel-agent

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

SET UP Laravel authentication with Sanctum/Fortify/Breeze, guards, roles & permissions, policies, social login, 2FA; when initializing auth in a new project (NOT for reference questions).

Install

npx vskill@latest install hadyfayed/laravel-agent/auth-setup

SKILL.md

The same SKILL.md was published earlier as hadyfayed/laravel-agent/auth-setup.

Environment

  • Installed packages: !composer show laravel/sanctum 2>/dev/null && echo "sanctum=yes" || echo "sanctum=no"; composer show laravel/passport 2>/dev/null && echo "passport=yes" || echo "passport=no"; composer show laravel/fortify 2>/dev/null && echo "fortify=yes" || echo "fortify=no"; composer show spatie/laravel-permission 2>/dev/null && echo "spatie=yes" || echo "spatie=no"; composer show santigarcor/laratrust 2>/dev/null && echo "laratrust=yes" || echo "laratrust=no"

Task

Wire up authentication and authorization. $ARGUMENTS carries the preset (api, spa, oauth, social, web, full) and optional --authz= flag.

Presets

PresetAuth typePackages
apiToken APIlaravel/sanctum
spaCookie/CSRF SPAlaravel/sanctum
oauthOAuth2 serverlaravel/passport
socialSocial loginlaravel/socialite (+ socialiteproviders
webSession (Breeze/Fortify)laravel/breeze or laravel/fortify
fullAll of the aboveper option

Authorization choices: spatie (roles+permissions, simple), laratrust (teams+roles+permissions, complex), policies (Laravel built-in only).

Steps

  1. Install missing packages for the chosen preset (use the environment output above to skip what is already present):

``bash composer require laravel/sanctum # api / spa composer require laravel/passport # oauth composer require laravel/breeze # web (then: php artisan breeze:install) composer require spatie/laravel-permission # authz=spatie composer require santigarcor/laratrust # authz=laratrust ``

  1. Publish vendor config / migrations as each package requires:

``bash php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider" php artisan passport:install # oauth — client keys + personal-access client php artisan laratrust:setup # authz=laratrust — config + migration ``

  1. Configure `config/auth.php` guards and providers:
  • web (session) for browser flows.
  • sanctum (or api) for tokens; passport driver for OAuth2.
  • Define the user provider explicitly.
  1. Add routes under routes/api.php and/or routes/web.php:
  • POST /login, POST /logout, POST /register.
  • Sanctum SPA: GET /sanctum/csrf-cookie, guarded user endpoint.
  • Social: GET /auth/{provider}/redirect, GET /auth/{provider}/callback.
  1. Authorization — follow the conventions in the laravel-auth skill for policies, gates, roles, and permission seeding rather than duplicating them here. Seeders should create roles (e.g. super-admin, admin, user) and attach permissions.
  1. Optional extras when requested:
  • 2FA — enable via Fortify two-factor-challenge configuration.
  • Rate limiting — apply throttle to login/register routes.
  1. Run migrations and seed authorization data:

``bash php artisan migrate php artisan db:seed --class=RolesAndPermissionsSeeder ``

  1. Report installed packages, routes added, roles/permissions created, and the .env keys still required (e.g. provider API keys for social, PASSPORT_PRIVATE_KEY).

Security guardrails

  • Hash passwords via the hashed cast or Hash::make() — never plain.
  • Regenerate the session after login; revoke tokens on logout.
  • Require HTTPS in production; never log credentials or tokens.

Reference

Deep auth patterns — guards, policies, gates, Sanctum/Passport/Socialite integration, 2FA — live in the laravel-auth reference skill. Apply those conventions when implementing the wiring above.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
13
Repository forks
1
7-day trend score
13

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hadyfayed/laravel-agent/auth-setup/badge)](https://verified-skill.com/skills/hadyfayed/laravel-agent/auth-setup)

Something wrong with this skill or its page? Tell us.