hcweb

743 经验值

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

最近在开发一个cms 我想再后台直接做数据库备份与还原 找了好多包但是只有备份没有还原功能 请问各位朋友要怎么做?

请问朋友是如何处理的?我的本地正常,放到服务器上报错,本地和服务器都是windows系统

GuzzleHttp Exception RequestException
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see //curl.haxx.se/libcurl/c/libcurl-errors.html)

我在数据库里面直接创建posts表的category_id和comment_id外键约束却可以 就是通过命令行不行!migrations里面创建的先后顺序是posts>categorys>comments!

群主 好 comments和categorys这两张表都有的 我再想是不是migrate创建的时候时间先后顺序有影响?

n Connection.php line 664:

SQLSTATE[HY000]: General error: 1005 Can't create table n_fruit.#sql-3fa0_23 (errno: 150 "Foreign key constrain
t is incorrectly formed") (SQL: alter table posts add constraint posts_comment_id_foreign foreign key (comment _id) references comments (id) on delete cascade)

In Connection.php line 458:

SQLSTATE[HY000]: General error: 1005 Can't create table n_fruit.#sql-3fa0_23 (errno: 150 "Foreign key constrain
t is incorrectly formed")

Process finished with exit code 1 at 13:53:34.
Execution time: 12,000 ms.


$table->unsignedInteger('comment_id')->comment('评论id');
            $table->unsignedInteger('category_id')->comment('所属分类id');
            $table->foreign('comment_id')
                  ->references('id')
                  ->on('comments')
                  ->onDelete('cascade');

            $table->foreign('category_id')
                ->references('id')
                ->on('categorys')
                ->onDelete('cascade');

外键约束报错 求大神指导 感谢!

public function store(UserRequest $request)

{
    //开启事务
    \DB::transaction(function () use ($request) {
        $role = $request->input('roles');
        //保存用户
        $user = User::create($request->except(['_token', 'roles', 'password_confirmation']));
        //赋予角色
        $result = $user->assignRole($role);
        if ($result) {
            alert()->success('用户添加成功!');
        } else {
            alert()->error('用户添加失败!');
        }
        return redirect()->route('user.index');
    });
}

请问各位大神如何才知道,事务执行成功?我这样子做redirect无效 数据是已经保存了!