Controller.php
642 字节
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
/**
* 非本站链接,中转跳转
* @author:dc
* @time 2023/1/16 9:22
*/
public function redirect($url){
if(!preg_match("/^http(s?):\/\//",$url)){
$url = 'http://'.$url;
}
return redirect($url,302);
}
}