git composer构建的时候报 psr-4的错误

问题:Class App\Servitization\UfileSerivitization located in ./app/Servitization/UfileServitization.php does not comply with psr-4 autoloading standard. Skipping.



"autoload": {
        "classmap": [
        "psr-4": {
            "App\\": "app/"

解决Laravel错误1071 Specified key was too long的多种方法

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

解决Laravel错误1071 Specified key was too long的多种方法

If you are using MariaDB or an older version of MySQL, you need to place this code in your AppServiceProvider.php:

use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); }
Inside config/database.php, replace this line for mysql

‘engine’ => null’,

‘engine’ => ‘InnoDB ROW_FORMAT=DYNAMIC’,
Instead of setting a limit on your string lenght.

Change database.php which is in config folder where it says

‘charset’ => ‘utf8mb4’, ‘collation’ => ‘utf8mb4_unicode_ci’,
I changed these to

‘charset’ => ‘utf8’, ‘collation’ => ‘utf8_unicode_ci’,

laravel 图片上传与前端显示问题

laravel 是无法访问

storage/app/public/images   里面的图片的



执行命令:php artisan storage:link

命令执行完毕后,就会在项目里多出一个 public/storage,

这个 storage 就是一个软链接,它指向 storage/app/public 目录。

public/storage(软连接) → storage/app/public