dongyi5570 2016-03-17 14:03
浏览 33

Laravel 5.2 route:cache更改了我的url()输出

I came accross a strange behavior from Laravel 5.2 and i would like to know if this happened to anyone else or only on my bad luck.

I have a function called optimize:

function optimize()
{
    $url = url('backend');
    \Artisan::call('route:cache');
    \Artisan::call('config:cache');

    return redirect()->to($url)->withMessage(_t('system_optimized'))->withMsgtype('success');

}

If i output the $url var then i get something like: http://devhost.dev/Cartaki/backend but if i output url('backend'); after the Artisan calls then i get something like this: http://devhost.dev/backend.

I solve this issue by using the $url var as a path to the redirect()->to() method but the problem is there.

Another strange thing is that my flash message will not show up after the redirection. If i comment out the artisan calls, then my flash message will show up as expected.

Any thoughts on this one?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
    • ¥15 Arduino无法同时连接多个hx711模块,如何解决?