都试过了,但没用,不知道是哪里不对。
您好,我想问一下,我如何下载 storage/exports/*.xls文件,
return response()->download($filename.'.xls');,这句话好像不能下载,说是找不到文件,请问如何修改,谢谢!
<?php
namespace AppHttpControllerAdmin;
use IlluminateHttpRequest;
use AppHttpRequests;
use AppHttpControllersController;
use Session,Redirect;
class BaseController extends ControllerAdmin
{
public function __construct()
{
$this->isLogin();
}
public function isLogin()
{
$sess_key = Session::get('adminVal');
if ($sess_key == null){
return Redirect::to('admin\login.index');
}
}
}
这里有一个后台基类控制器,里面判断用户是否登录,然后如果没有登录就跳转到指定方法,但是里面的那句“return Redirect::to('adminlogin@login')”不管用。页面总是跳转到登录之后的首页。而不是到登录页面。
谁能给我讲解一下,指出错误所在。
这是我的一张articles表的结果
public function up()
{
Schema::create('articles', function (Blueprint $table) {
$table->increments('id'); //主键id自增
$table->integer('dr_users_id')->unsiged();
$table->string('title')->default(''); //文章标题
$table->text('body'); //文章内容
$table->integer('read')->default(0); //阅读次数
$table->timestamp('published_at'); //文章发布时间
$table->foreign('dr_users_id')->references('id')->on('dr_users')->onDelete('cascade');
$table->timestamps(); //自动维护create_at和update_at时间戳
});
}
但是在用 php artisan migrate生成时出错了,显示如下信息
[IlluminateDatabaseQueryException]
SQLSTATE[HY000]: General error: 1005 Can't create table 'doc_db.#sql-a1e_26bc' (errno: 150) (SQL: alter table articles
add constraint articles_dr_users_id_foreign
foreign key (dr_users_id
) references dr_users
(id
) on delete cascade)
其中dr_users表也是可以正常生成的,但就是这张articles表无法正常生成
请问是什么原因?谢谢
哦,那我再试试,谢谢
在用Mail::queue发送邮件时,显示如下错误信息
Swift_TransportException in StreamBuffer.php line 268:
Connection could not be established with host smtp.mxhichina.com [Connection timed out #110]
bbs.duoyon.com 网页无法正常运作
bbs.duoyon.com 目前无法处理此请求。
HTTP ERROR 500
就直接显示这个错误
用户注册后,按视频教程应该跳到首页面,但是现在是直接显示500错误,但用户注册信息是可以正常入库的,是在发送邮件的那段代码上出错了
改过了,也没有用