定制 maxweb/save-url 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maxweb/save-url

Composer 安装命令:

composer require maxweb/save-url

包简介

Laravel 5 package to redirect users to the last visited page on login.

README 文档

README

Introduction

This package allows you to easily redirect users to the last visited page on login.

Laravel compatibility

Laravel translation
5.1.x 1.0.x
5.2.x 1.0.1 and up
5.3.x 1.0.2 and up
5.4.x 1.0.3 and up
5.5.x 1.0.4 and up

Installation

Require through composer

composer require maxweb/save-url 1.0.x

Or manually edit your composer.json file:

"require": {
	"maxweb/save-url": "1.0.x"
}

Publish the configuration file:

php artisan vendor:publish

This package supports Laravel 5.5's automatic package discovery feature, so there is no need to add anything to config/app.php in Laravel 5.5 and above.

Usage

Cached urls

By default, the last visited URL visited by a user is saved in Session. URLs must follow these criteria to be saved:

- Only GET requests are saved.
- AJAX requests are not saved.
- If the user is logged in, no urls are saved.

Excluding urls from the cache

If you want to exclude certain urls from the url cache, like for example the login and signup pages, you may use the provided "doNotSave" middleware:

// routes/web.php

Route::get('/login', ['middleware' => 'doNotSave', 'uses' => 'AuthController@login']);

Redirecting after login

To redirect the user to the last saved url, such as after authentication, you may use:

public function login() {
	/** Auth user **/
	if ($success) {
		redirect()->toSavedUrl();
	}
}

统计信息

  • 总下载量: 42
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固