小编Mah*_*esi的帖子

laravel / framework需要ext-mbstring

我正在使用Kali linux,并且在安装laravel框架时遇到困难。我喜欢在不同环节havelooked了一个和manyothers但似乎没有任何工作。我所做的每一件事。它不断带来这个错误

laravel/framework v5.5.9 requires ext-mbstring -> ...
...
Run Code Online (Sandbox Code Playgroud)

例如:

root@iO-PC:/opt/lampp/htdocs/projects# composer create-project laravel/laravel Test "5.5.*"
Run Code Online (Sandbox Code Playgroud)

处理中。这就是显示的内容。

    Installing laravel/laravel (v5.5.28)
  - Installing laravel/laravel (v5.5.28): Loading from cache
Created project in Test
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.5.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your …
Run Code Online (Sandbox Code Playgroud)

installation laravel laravel-5.5

5
推荐指数
3
解决办法
8762
查看次数

Laravel编写器更新错误 - 无法解码响应:zlib_decode():数据错误

我在更新项目中的依赖项时遇到问题.问题:

无法解码响应:zlib_decode():data error重试降级模式,请查看https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode了解更多信息

php laravel composer-php laravel-5.1

4
推荐指数
1
解决办法
6265
查看次数

如何通过 Laravel 迁移创建外键?

我们怎样才能使 areferenced keyforeign keyin laravelby migrations. 认为我在 laravel 的数据库目录中有两个迁移文件,它们都在我的数据库中创建了一个不同的表。第一次迁移创建一个表,该表用于帖子,其中有一列名为 Id。第二次迁移创建评论表,其中有一列名为 post_id。现在the Id column in posts table is referenced keypost_id in comments table is foreign key,我如何将这两列连接在一起?

laravel laravel-5

2
推荐指数
1
解决办法
1万
查看次数

Laravel 验证唯一

我有一个带有唯一列的表。我的表单验证规则如下所示:

    return Validator::make($data, [
      'nameEN'   => 'required|string',
      'nameHE'   => 'required|string',
      'address'  => 'required|string|min:10|unique:clients'
    ]);
Run Code Online (Sandbox Code Playgroud)

我的问题是,当我编辑一行时,如果我没有更改地址列,我会收到验证错误。

我的编辑功能如下所示:

public function editPost(Request $request,$id){
    $client = new Client();
    $client->editValidation($request->all())->validate();
    $row = $client->where('id',$id)->get()->first();
    $update = array();
    if(!empty($request->input("nameEN"))    && $request->input("nameEN")    != $row->nameEN) $update["nameEN"] = $request->input("nameEN");
    if(!empty($request->input("nameHE"))    && $request->input("nameHE")    != $row->nameHE) $update["nameHE"] = $request->input("nameHE");
    if(!empty($request->input("address"))   && $request->input("address")   != $row->address) $update["address"] = $request->input("address");

    if(empty($update)) $message = $this->message("info", "Notic: Client {$row->nameEN} was not updated because nothing was changed.");
    else if($client->where("id",$row->id)->update($update)){
        $message = $this->message("success", "Client {$row->nameEN} was updated.");
    } else …
Run Code Online (Sandbox Code Playgroud)

php mysql validation laravel-5 laravel-5.6

2
推荐指数
1
解决办法
9854
查看次数

如何实现go grpc-go健康检查?

我一直在寻找grpc-go健康检查的文档和代码示例。

寻找问题

没有明确的答案可以在我的程序中重复使用来实施健康检查。

go grpc grpc-go

2
推荐指数
1
解决办法
1万
查看次数

无法与主机 smtp.mailtrap.io 建立连接

我正在尝试在 Laravel 中使用 smtp.mailtrap.io 向电子邮件发送消息。我遵循了一个 youtube 教程,并不断收到以下错误。

无法与主机 smtp.mailtrap.io 建立连接

为此,我在下面附上了我的代码。

页面控制器

    <?php 

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Post;
use Mail;
use Session;

class PagesController extends Controller {

public function getIndex() {
$posts = Post::orderBy('created_at', 'desc')->limit(4)->get();
return view('welcome')->withPosts($posts);
}

public function getAbout() {
$first = 'Niamh';
$last = 'Flannery';

$fullname = $first . " " . $last;
$email = 'niamh3516@hotmail.co.uk';
$data = [];
$data['email'] = $email;
$data['fullname'] = $fullname;
return view('pages.about')->withData($data);
}

public function getContact() {
return view('contact'); …
Run Code Online (Sandbox Code Playgroud)

html php email laravel

1
推荐指数
1
解决办法
1万
查看次数

为history.back按钮定义参考站点

我们希望在我们的网站上有一个后退按钮,但javascript中的history.back对我们没有帮助.我们需要此功能仅在站点上运行,如果用户来自其他站点,则不应返回上一站点上的返回按钮.

实际上,我们只想在我们的网站上运行一个返回按钮.我的代码是

<a href="javascript:history.back();" class="btn btn-danger btn-rounded btn-anim"><i class="fas fa-arrow-left"></i><span class="btn-text">Back</span></a>
Run Code Online (Sandbox Code Playgroud)

html javascript php

1
推荐指数
1
解决办法
67
查看次数