Download the PHP package 1970mr/laravel-redirector without Composer

On this page you can find all versions of the php package 1970mr/laravel-redirector. 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 laravel-redirector

Laravel Redirector

A Laravel package for managing URL redirects easily and efficiently.

Table of Contents

Installation

You can install the package via Composer:

Next, you need to publish the migration and the config file:

Run the migrations to create the necessary database table:

Configuration

The package provides a configuration file where you can manage various settings, including caching methods and TTL (Time-To-Live). These settings allow you to optimize the performance and scalability of your redirects. Refer to the config/redirector.php file for more details.

Usage

Middleware

To use the redirect middleware, you can apply it to specific routes, groups of routes, or add it globally to the HTTP kernel middleware stack.

Specific Routes

Global Middleware

In Laravel 11, you can add middleware globally in your bootstrap/app.php file:

Alias Middleware

You can use the middleware by its alias or by the class name in your routes:

Artisan Commands

The package provides several Artisan commands to manage redirects:

Create Redirect

To create a redirect, you can use the redirect:create Artisan command. This command allows you to specify the source URL, destination URL, status code, and whether the redirect is active.

Examples
  1. Redirect from /old-page to /new-page with a 301 status code and set it as active:

  2. Redirect from /specific-page to https://google.com with a 301 status code and set it as active:

Update Redirect

To update an existing redirect, you can use the redirect:update Artisan command:

Example

Update the redirect from /old-page to /new-destination with a 302 status code and set it as active:

Delete Redirect

To delete a redirect, use the redirect:delete Artisan command:

Example

Delete the redirect from /old-page:

List Redirects

To list all configured redirects, use the redirect:list Artisan command:

Controller and Views

You can also set up a more customizable CRUD interface for redirects using controllers, requests, routes, and views. The package provides a command to scaffold these components:

This command will install the necessary controllers, requests, routes, and views for managing redirects through a web interface.

Custom Implementation

Additionally, you can use the Redirect model directly to create, update, or delete redirects within your application code as needed. This approach allows for complete customization of how and where redirects are managed.

Caching

The package supports two caching methods:

You can configure the caching method and TTL in the config/redirector.php file to suit your application's needs.

Testing

To run the tests for the package, use the following command:

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-redirector with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0||^10.0
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 1970mr/laravel-redirector contains the following files

Loading the files please wait ....