Download the PHP package marshmallow/redirectable without Composer

On this page you can find all versions of the php package marshmallow/redirectable. 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 redirectable

alt text

Laravel Redirectable

Latest Version on Packagist Tests Total Downloads

Store redirects via Nova and load them in your routes.

Redirectable lets you manage HTTP redirects from a Laravel Nova resource and serve them as real, cacheable routes. Redirects can be standalone or attached (polymorphically) to any Eloquent model — for example a page resource — so that when a model's slug changes, its old URLs keep pointing at the right place.

Installation

Install the package via Composer:

The service provider is auto-discovered and the package migrations are loaded automatically. Run them with:

This creates the redirects table.

Optionally publish the config file:

Configuration

The published config/redirectable.php exposes the following keys:

Key Default Description
database.connection null Database connection used when checking whether redirect routes should be loaded. null uses the default connection.
models.redirect Marshmallow\Redirectable\Models\Redirect::class The Eloquent model used to store and resolve redirects. Override to use your own model.
types [Marshmallow\Pages\Nova\Page::class] Nova resources that may be associated with a redirect via the MorphTo field.
http_codes [301 => '301 Moved Permanently'] The HTTP status codes selectable in Nova when creating a redirect.

Usage

Register the redirect routes

Call Redirector::routes() in your routes/web.php so the stored redirects are registered as routes. They are added last, never overriding existing application routes, and can be route-cached:

When a registered redirect URL is hit, the package resolves the final destination (following chained redirects) and returns a redirect response with the configured HTTP code.

Manage redirects in Nova

Register the bundled Nova resource in your NovaServiceProvider:

The resource appears under the SEO group and lets you set the source path (redirect this), the destination (to this), the HTTP code, and an optional associated resource.

Attach redirects to a model

Add the Redirectable trait to any model you want to attach redirects to. It provides a redirectable() morph-many relation:

You can then create redirects for that model through the Redirector facade. add() records a redirect, removes redirects made obsolete by the new destination, and re-points existing trailing redirects to the new destination:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see the Marshmallow packages contribution process for details. Pull requests are welcome.

Security Vulnerabilities

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


All versions of redirectable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/database Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
laravel/nova Version ^4.0|^5.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 marshmallow/redirectable contains the following files

Loading the files please wait ...