How eamirgh/laravel-rest-auth-example works
Project type and purpose
• This is a full-stack Laravel web application implementing user registration, login with one-time passwords (OTPs), and device management.
• Key features: RESTful API endpoints (routes/api.php), email-based OTP delivery, Eloquent models for User, Otp, Device, event/listener architecture for post-login actions, Blade templates for views, and asset compilation via webpack.mix.js.
File structure
• app/
– Http/Controllers: AuthController handles register, login, OTP verification.
– Models: User, Otp, Device represent your domain.
– Events & Listeners: LoggedIn event triggers NotifyOtp mailer.
– Middleware: authentication, CSRF, maintenance, etc.
• routes/
– api.php: JSON endpoints for mobile or SPA clients.
– web.php: Blade view routes.
• resources/
– views/: Blade email template and welcome page.
– js/, css/: front-end assets compiled by Laravel Mix.
• database/
– migrations: schema for users, otps, devices, jobs, tokens.
– factories & seeders: test data.
• config/: mail, queue, database, session drivers.
• public/: entry point (index.php), static assets, .htaccess.
README for additional insights
• The README is the stock Laravel overview.
• Confirms use of core Laravel systems: routing, DI container, Eloquent ORM, background jobs, broadcasting.