sukohi/fox-tail
Larablocks Analysis
sukohi/fox-tail works with Laravel 5 (latest release 1.0.2, Jun 15, 2017), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Jun 15, 2017)
- 0 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jun 15, 2017.
- No releases in the last 12 months.
- First released: Jun 15, 2017.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.
| Install | |
|---|---|
composer require sukohi/fox-tail |
|
| Latest Version: | 1.0.2 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Jun 15, 2017 |
| Links: | GitHub · Packagist |
FoxTail
A Laravel package to manage routes user accessed. (L5.4+)
Installation
Execute the next command.
composer require sukohi/fox-tail:1.*
Set the service provider in config/app.php.
'providers' => [
...Others...,
Sukohi\FoxTail\FoxTailServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'FoxTail' => Sukohi\FoxTail\Facades\FoxTail::class,
]
Then execute the next commands.
php artisan vendor:publish
Now you have config/fox_tail.php.
Definition
-
Tail: A set of data a user will access. It contains
name(route name or uri),method,url,full_urlandparameters. -
Story: A set of
Tailsuser could access.
Preparation
(Middleware)
You need to set FoxTailMiddleware in \App\Http\Kernel.php like so.
protected $routeMiddleware = [
...Others...,
'fox_tail' => \Sukohi\FoxTail\Middleware\FoxTailMiddleware::class
];
And also in routes/web.php
Route::middleware(['fox_tail'])->group(function(){
Route::get('/my/page/1', 'HomeController@mypage_1')->name('my-page-1');
Route::get('/my/page/2', 'HomeController@mypage_2')->name('my-page-2');
Route::get('/my/page/3', 'HomeController@mypage_3')->name('my-page-3');
});
In this case, FoxTail watches /my/page/1, /my/page/2 and /my/page/3.
Then, it will keep Tail in session.
(Config)
In config/fox_tail.php, you can set Story which means user's access history.
See the file for the details.
Usage
Check if Story you set in the config file matches.
$story_name = 'how_much';
if(\FoxTail::isStory($story_name)) {
echo 'Match!';
}
Get all Tails
$tails = \FoxTail::getTails(); // Laravel Collection
Get a Tail
$tail = \FoxTail::getTail($tail_name);
echo $tail->method;
echo $tail->url;
echo $tail->full_url;
print_r($tail->parameters); // Array
// or
echo \FoxTail::getMethod($tail_name);
echo \FoxTail::getUrl($tail_name);
echo \FoxTail::getFullUrl($tail_name);
print_r(\FoxTail::getParameters($tail_name)); // Array
Check if FoxTail has a Tail or not
$tail_name = 'about_us';
if(\FoxTail::has($tail_name)) {
echo 'Has it!';
$tail = \FoxTail::getTail($tail_name);
}
Check if the previous Tail name
$tail_name = 'about_us';
if(\FoxTail::isPrevious($tail_name)) {
echo 'That is right!';
}
Get Tail and Tail name by step
echo \FoxTail::getTailNameByStep(); // Current tail
echo \FoxTail::getTailNameByStep(1); // The previous tail tail
print_r(\FoxTail::getTailByStep()); // Current tail by step
print_r(\FoxTail::getTailByStep(1)); // The previous tail by step
License
This package is licensed under the MIT License.
Copyright 2017 Sukohi Kuhoh
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| 1.0.2 | ~5.0 | MIT | |
| 1.0.1 | ~5.0 | MIT | |
| 1.0.0 | ~5.0 | MIT |