小编mer*_*dan的帖子

Laravel create migration file in specific folder

I've created Payment package for my laravel project像这儿

I want to make migration files inside migrations folder of my package. How can create it using artisan command? I want something like

php artisan make:migration packages/Payment/src/Database/add_orderId_to_cart_payment_table
Run Code Online (Sandbox Code Playgroud)

migration laravel laravel-5 artisan

7
推荐指数
2
解决办法
437
查看次数

如何为laravel和yii项目正确配置nginx?

我正在尝试配置 nginx 以在同一域上为 laravel 和 yii 项目提供服务。我的 Laravel 项目运行良好。Yii 项目也可以工作,但 yii 项目上的资产文件夹给出err_aborted not found 404。所有 js css ... 文件未找到

server {

server_name mydomain.com;
index index.html index.php;
charset utf-8;
set $base_root /var/www;
# App 1 (main app)
location / {
    root $base_root/telemele/public;
    try_files $uri $uri/ /index.php?$query_string;
    error_log /var/log/nginx/telemele.notice.log notice;
    error_log /var/log/nginx/telemele.error.log error;

    location ~* ^/index\.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /var/www/telemele/public/index.php;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }
}

# …
Run Code Online (Sandbox Code Playgroud)

nginx yii

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

带有 gte:1 的 Laravel 验证数字抛出异常

为什么 Laravel 抛出

InvalidArgumentException('The values under comparison must be of the same type');

例外,当在规则上输入非数字文本(如“test”)时:

public function rules()
{
    return [
        'account_no' => 'required|numeric|gte:1'
    ];
}
Run Code Online (Sandbox Code Playgroud)

当预期只是不通过验证并显示消息时:

account_no field must be numeric

如何解决这个异常?

validation laravel

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

标签 统计

laravel ×2

artisan ×1

laravel-5 ×1

migration ×1

nginx ×1

validation ×1

yii ×1