SUKOHI / Warp by Sukohi

A PHP package mainly developed for Laravel to remember URLs to redirect through session.
32
0
2
Package Data
Maintainer Username: Sukohi
Maintainer Contact: capilano.sukohi@gmail.com (Sukohi)
Package Create Date: 2015-06-08
Package Last Update: 2016-04-18
Language: PHP
License: MIT
Last Refreshed: 2024-05-14 15:06:25
Package Statistics
Total Downloads: 32
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Warp

A PHP package mainly developed for Laravel to remember URLs to redirect through session.
(This is for Laravel 5+. For Laravel 4.2)

Installation

Add this package name in composer.json

"require": {
  "sukohi/Warp": "2.*"
}

Execute composer command.

composer update

Register the service provider in app.php

'providers' => [
    ...Others...,  
    Sukohi\Warp\WarpServiceProvider::class,
]

Also alias

'aliases' => [
    ...Others...,  
    'Warp'   => Sukohi\Warp\Facades\Warp::class
]

Usage

\Warp::set('my_place');
\Warp::set('my_place', $current_url = '');  // or You can set URL you want to keep.


// After moving some pages 

$url = \Warp::get('my_place');
$url = \Warp::get('my_place', $alternative_url = 'http://example.com');    // You also can set alternative(default) URL.
$url = \Warp::get('my_place', $alternative_url, $forget_flag = true);      // If $forget_flag is false, URL you set will not be removed.

with Route name

Warp::set('your.route.name');   // the argument is optional. If in the case, route name automatically will be set.

// After moving some pages 

$url = Warp::route('your.route.name');

License

This package is licensed under the MIT License.

Copyright 2015 Sukohi Kuhoh