Skip to content

Installation

Jean-Marc Strauven edited this page Dec 23, 2025 · 1 revision

Installation

This guide will help you install Laravel ApiRoute in your Laravel application.


Requirements

Before installing, make sure your environment meets the following requirements:

Requirement Version
PHP 8.3+
Laravel 12.x

Install via Composer

Install the package using Composer:

composer require grazulex/laravel-apiroute

Publish Configuration

Publish the configuration file to customize the package behavior:

php artisan vendor:publish --tag="apiroute-config"

This will create config/apiroute.php with all available options.


Publish Migrations (Optional)

If you want to use the usage tracking feature, publish the migrations:

php artisan vendor:publish --tag="apiroute-migrations"

Then run the migrations:

php artisan migrate

Service Provider

The package uses Laravel's auto-discovery, so the service provider is automatically registered.

If you have disabled auto-discovery, add the service provider manually to config/app.php:

'providers' => [
    // ...
    Grazulex\ApiRoute\ApiRouteServiceProvider::class,
],

Facade (Optional)

The ApiRoute facade is automatically registered. If needed, you can add it manually:

'aliases' => [
    // ...
    'ApiRoute' => Grazulex\ApiRoute\Facades\ApiRoute::class,
],

Verify Installation

Verify the installation by running:

php artisan api:status

You should see:

No API versions registered.

This confirms the package is installed correctly.


Next Steps

Clone this wiki locally