Download the PHP package amiraghaee/redirector without Composer
On this page you can find all versions of the php package amiraghaee/redirector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amiraghaee/redirector
More information about amiraghaee/redirector
Files in amiraghaee/redirector
Package redirector
Short Description with using this package, you can manage the header status code of routes. you can redirect or abort routes with status code.
License MIT
Homepage https://github.com/amiraghaee/redirector
Informations about the package redirector
Laravel Redirector
with using this package, you can manage the header status code of routes. you can redirect or abort routes with status code. I try to create this package like Wordpress Yoast plugin.
Installation
Via Composer
To adjust the package to your needs, you can publish the config file config/redirector.php to your project's config folder using:
Configurations
Data Engine
This package already support two data engine!
- Redis
- Eloquent
Strongly we recommend Redis database! Eloquent maybe affect to speed of your website.
Default data engine is redis, but you can change it in config/redirector.php.
accepted values are 'redis' and 'eloquent'
If you have selected the Eloquent data engine, you must run the migration command to add the "redirector" table to the database.
Usage
Use redirector namespace on top of your controller or wherever you want:
set role:
You can add roles with this method. it will be return boolean value.
parameters
Parameter | Required | Description | Type |
---|---|---|---|
route | yes | The source route that you want to change the header status | string |
status | yes | header status code. 300 range for redirect and 400 for abort | integer |
endpoint | No | if status code was in 300 range, request will be redirect to this route | string |
get all roles:
You can get all roles with this method. this method will be return collocation type value.
get specific role:
You can get specific role with this method. this method will be return collocation type value.
parameters
Parameter | Required | Description | Type |
---|---|---|---|
route | yes | The source route that you want get | string |
delete specific role:
You can delete specific role with this method. this method will be return collocation type value.
parameters
Parameter | Required | Description | Type |
---|---|---|---|
route | yes | The source route that you want get | string |
fresh database:
You can delete all roles with this command.
License
MIT. Please see the license file for more information.
TODO:
- [x] Add command for fresh database!
- [x] Add eloquent database!
- [x] Add redis database!
- [ ] Add cache to eloquent database!