Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Api Laravel Package

1codehappy/laravel-api

A Laravel package that aims to simplify common API setup with reusable structure and response helpers. It offers a lightweight starting point for small projects seeking more consistent API endpoints, though it has limited adoption and documentation.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install the release with composer require <vendor>/<package>:^2.0.2, then publish the package assets:
    php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider"
    
  • Run migrations if the package ships auth-related tables:
    php artisan migrate
    
  • Read the updated readme.md first, especially the new Clockwork section. Clockwork is a local debugging aid and should not be treated as production middleware without review.
  • Inspect the registered routes before wiring anything up:
    php artisan route:list --path=api
    
  • First practical use case: wire up the new password reset services behind your existing API auth flow. The 2.0.2 release adds dedicated services for resetting passwords, so start by locating those classes and confirming how they are bound in the container. A typical first endpoint pair is:
    • request reset link / code
    • consume token and set new password
  • Check the generated API docs after install. The release notes mention API docs fixes, but docs can still lag behind your app-specific routes and response shapes.

Implementation Patterns

  • Use the password reset services directly rather than duplicating logic in controllers. Keep controllers thin: validate the request, call the reset service, map the result to an API response.
    public function reset(ResetPasswordRequest $request, PasswordResetService $service)
    {
        $service->reset($request->validated());
    
        return response()->json(['message' => trans('passwords.reset')]);
    }
    
  • Prefer the package’s language keys over hard-coded messages. Since 2.0.2 uses language files instead of predefined messages, publish or override the package translations and reference them with trans() / __() so responses stay consistent and localizable.
  • Treat Clockwork as a development integration. Register or enable it only in local/staging environments. Use it to inspect the password reset request lifecycle, mailables, notifications, and service calls during development.
  • Integration tip: if your app already has its own password broker or reset notifications, don’t run both flows blindly. Decide whether the package services replace your existing broker or sit alongside it, and avoid duplicate token generation.
  • Test against the package’s own test suite as usage examples. The 2.0.2 release includes test fixes, so the tests are a useful reference for expected request payloads, token behaviour, and service responses.
  • API docs workflow: regenerate or re-read the docs after upgrading. Use them to confirm endpoint names, required fields, and status codes, then add your own examples for any customised responses.
  • Keep configuration explicit. Publish the config and set token lifetime, throttling, and notification behaviour in your app’s environment rather than relying on package defaults.

Gotchas and Tips

  • Language file changes can break overrides. If you previously overrode predefined messages, compare your published lang files with the 2.0.2 versions. Missing or renamed keys will surface as raw translation keys in API responses.
  • Clockwork must not leak into production. Review the readme carefully, gate registration by environment, and confirm no Clockwork routes or middleware are exposed publicly.
  • Route caching: after adding or changing package routes, run php artisan route:clear and php artisan route:cache as appropriate. Stale route caches are a common cause of “endpoint not found” during upgrade testing.
  • Service container bindings: if you decorate or replace the password reset service, bind against the package contract/interface rather than the concrete class where possible. This keeps upgrades to 2.x minor releases less fragile.
  • Password reset tokens are security-sensitive. Confirm token expiry, throttling, and invalidation behaviour after upgrading. Test the full flow: request, receive notification, consume token, reject reused or expired token.
  • API docs can be directionally useful but incomplete. The release notes say docs were fixed, not that they are exhaustive. Validate actual responses in tests rather than trusting examples alone.
  • Run the package tests and your own auth feature tests after upgrade. The test fixes in 2.0.2 may reveal assumptions in your app’s tests around response messages, status codes, or service behaviour.
  • Debugging tip: when a reset request fails silently, check the language file, the notification/mail configuration, and the service’s return value in that order. Clockwork can help confirm whether the service was reached and what it returned.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo