Core Laravel Interview Questions and Answers
Laravel is a PHP framework that helps you build web applications. It gives you built-in tools for common tasks like handling web…
Laravel developers use Spatie’s packages to add features without writing all the code themselves. A Laravel package bundles reusable PHP code for a Laravel project, and developers usually install it through Composer, PHP’s dependency manager. Because Spatie’s open-source catalog lists hundreds of projects, you can easily miss its smaller utilities. We use "less-known" here as an editorial description rather than a measured claim about developer awareness.
The 15 packages below each solve a narrow problem, from archiving deleted records to tracing SQL queries. Before you install any of them, check what problem it solves, what trade-offs it introduces, and what you need to verify in your own setup. Every package has its own Laravel and PHP version requirements, maintenance cadence, and setup steps.
laravel-deleted-modelsLaravel’s Eloquent models represent database records as PHP objects. When you delete a model, laravel-deleted-models copies its attributes into a separate deleted_models table, where you can restore the record by ID or delete it permanently later.
Choose this package when you want a recycle bin that keeps deleted rows out of your main tables. If you use Laravel’s built-in soft deletes instead, Laravel leaves the deleted row in its original table and marks it as deleted. Before relying on laravel-deleted-models, check how it handles relationships and sensitive fields, and schedule pruning so old archives do not pile up. Its published default retention period is 365 days.
laravel-model-cleanupSpatie lists laravel-model-cleanup as a tool for removing database records you no longer need. Look at it when you want a structured way to clear out old rows.
Read the current documentation before you wire it up. You need to know how the package selects records, when it deletes them, and what safeguards it offers, so you can be sure it matches your retention rules and will not wipe data your code still uses.
laravel-personal-data-exportlaravel-personal-data-export builds ZIP files containing personal data. It is worth evaluating when your users need a downloadable copy of the data tied to their accounts.
Use it as a building block for an export feature rather than a full compliance solution. You still need to decide which data sources the export pulls from, who is allowed to request an archive, and how your application protects and deletes the finished ZIP file.
laravel-rate-limited-job-middlewareWhen Laravel queues a job, a worker picks it up and runs it later. laravel-rate-limited-job-middleware throttles how fast those queued jobs hit a rate-limited service, such as an external API.
By default, the README documents a default limit of five jobs per second, releasing any extra jobs to run again after five seconds. You can adjust both the rate limit and the backoff delay. Because Laravel includes its own tools for rate-limiting queued jobs, compare what the framework already gives you before adding another dependency. If you cannot predict how many retries a job will need, the package recommends limiting retries by time.
laravel-notification-loglaravel-notification-log saves a searchable database record of the notifications your app sends. You can query that history to show users what they received or to check whether you already sent a similar message.
Each log entry stores details like the notification type, recipient, channel, and a fingerprint that identifies the notification. The package ships with a 30-day pruning setting, and Laravel must run its scheduled model:prune command to clear out expired rows. Verify that your scheduler runs that command so the table does not grow without limit.
laravel-one-time-passwordsA one-time password (OTP) is a temporary code a user enters to sign in. laravel-one-time-passwords gives you an OTP flow out of the box, with six-digit codes, a two-minute expiry, email delivery, and a Livewire login component. (Livewire is a Laravel tool for building interactive interfaces in PHP.)
You can extend the package’s notification class to send codes over other channels, though you should check how each channel protects and delivers them. Make sure your login flow regenerates the session ID after authentication, as the documentation’s example shows. An OTP flow handles sign-in codes, while your application still needs to cover the rest of authentication security.
laravel-robots-middlewareMiddleware runs while Laravel handles an incoming request. laravel-robots-middleware attaches an X-Robots-Tag response header with an indexing directive like all or none.
Reach for it when your indexing rules change by route or application logic. Keep in mind that search engines read this header as guidance, and it never blocks anyone from opening a page. Put access control in your authentication and authorization rules.
laravel-resource-linksSpatie’s package catalog describes laravel-resource-links as a way to add links to Laravel API resources so clients can discover related endpoints or actions.
Read the current documentation before adopting it for a specific API standard or response format. The catalog entry does not say which conventions the package follows, so verify that its output matches what your API clients expect.
laravel-link-checkerlaravel-link-checker checks links inside a Laravel application. It is worth a look if you want automated link checks during site maintenance or content reviews.
First, check what the package inspects: stored content, route definitions, rendered pages, or another source. That scope determines which broken links it catches and whether it fits your publishing workflow.
laravel-partialcacheA Blade partial is a reusable piece of a page rendered by Laravel’s Blade templating engine. laravel-partialcache adds a Blade directive so you can cache rendered partials instead of caching an entire page.
Before you cache a partial, check how the package handles cache invalidation. Also make sure the cached HTML never contains user-specific data that another visitor could end up seeing.
laravel-route-discoverylaravel-route-discovery lets Laravel find routes automatically rather than relying only on manual route registration. It can fit a codebase where you want routes discovered by convention.
Check how the package discovers routes, excludes files, and handles custom rules. Those details matter if your app depends on route order or contains endpoints you do not want registered automatically.
laravel-optionslaravel-options builds option lists from different sources. Consider it when a form or dropdown needs choices pulled from more than one place.
Check which sources the package supports and how it formats each option before you build your UI around it. The catalog description is broad and leaves those details out.
laravel-directory-cleanuplaravel-directory-cleanup removes old files from specified directories so stored files do not pile up. It is a candidate for folders that hold temporary or disposable files.
Before you schedule deletions, check which filesystems and age rules the package supports, and see whether you can preview what it will delete. Keep its target directories separate from any files your application still needs.
laravel-sql-commenterSQL comments attach short notes directly to database queries. laravel-sql-commenter adds details about the controller, route, job, or source file that triggered a query, which helps a database monitoring tool trace slow queries back to your code.
Inspect the generated comments before turning the package on everywhere. Route names or source paths can expose details you do not want sitting in database logs or monitoring tools.
laravel-signal-aware-commandArtisan is Laravel’s command-line interface. laravel-signal-aware-command helps Artisan commands respond to operating-system signals, which tell a running process to take an action such as stopping.
Look at it for long-running commands that need to react to those signals. Check which signals the package handles and what it does when one arrives, because the catalog description alone does not guarantee a graceful shutdown.
A short package description can point you toward a useful tool, but it will not tell you whether the package fits your stack or is actively maintained. Before you install any of these packages, check its current documentation, Composer requirements, and release history. Managing package versions in Laravel is a helpful read if you want to keep your dependencies under control.
For the catalog-listed packages whose behavior is not covered in detail here, read the package documentation before designing around them. Confirm the details your code depends on, especially retention rules, cleanup scope, cache freshness, and who can access exported data.
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com