Download the PHP package vaened/laroute without Composer

On this page you can find all versions of the php package vaened/laroute. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laroute

Laroute

Build Status

vaened\laroute is a PHP library inspired by aaronlord/laroute, designed to help Laravel developers manage their application’s routes in JavaScript without the need to hardcode URLs. This library goes a step further by introducing modular routing, allowing you to separate routes based on URL patterns into different modules. Each module generates its own routes file, making it easier to manage and scale your application’s routing structure.

Installation

Laroute requires PHP 8.2. To get the latest version, simply require the project using Composer:

Publish the configuration file.

Now, generate the routes based on your configuration and export the JavaScript service.

Usage

The library includes the necessary javascript service to interpret the exported routes, along with its corresponding d.ts type definitions for typescript.

The location of the service is configured in the library option within the configuration file.

Javascript / Typescript

Once the service is exported to the location defined in the configuration file, you can easily create a new file and export the service creation by passing the file containing the routes as a parameter.

With this, you’re ready to start.

Additionally, you can export the routes as a TypeScript file to enable route autocompletion in your editor. To achieve this, simply modify the output option in the configuration file.

Service

The route service provides three key methods to interact with the generated routes:

Returns {host}/api/admin/products/80768395-4208-4fd7-ac60-c429717014ab?name=Notebook

Returns {host}/api/admin/products/80768395-4208-4fd7-ac60-c429717014ab

Returns true if the route exists, false otherwise.

Best Practices

To efficiently manage API calls, it’s advisable to create a dedicated file. You might name it Router.{ts, js}. In this file, you can utilize fetch or a library like axios to streamline your API interactions. An example of what you might export could look like this:

Configuration

The default configuration should be sufficient for most projects, allowing you to simply export the routes and start working without any additional setup.

For customization options, refer to the comments in the configuration file laroute.php.

Advanced

For larger projects, where different clients consume the API, you can configure the route export in a modular way. This allows you to create as many modules as needed, each corresponding to different URL segments.

For example, you could have a module for /api/store and another for /api/admin, which would generate two separate route files.

Features

License

This library is licensed under the MIT License. For more information, please see the license file.


All versions of laroute with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^10.21|^v11.15
vaened/support Version ^4.0
lambdish/phunctional Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vaened/laroute contains the following files

Loading the files please wait ....