algolia search

Tìm thấy x bài viết trong xms.

Ra mắt Laravel 5.7.16

Ra mắt Laravel 5.7.16


Bản released Laravel Framework 5.7.16 có gì mới.

Thêm mới

  • Thêm đa ngôn ngữ cho các trang báo lỗi mặc định 403.blade.php503.blade.php (#26751)
  • Migrator trước đây chỉ chấp nhận thư mục (lấy các file migrations trong thư mục đó), thì giờ đây chấp nhận thêm file đơn lẻ. (#26642c4b13bf)

Sửa lỗi

  • Sửa lỗi truy vấn khi HasManyThrough với chính mình (#26662)
    class User extends Model {
        public function teamMates() {
            return $this->hasManyThrough(self::class, Team::class, 'owner_id');
        }
    }
    
    User::has('teamMates')->get();​
    # kết quả mong muốn
    select * from `users` where exists (
      select * from `users` as `laravel_reserved_0`
      inner join `teams` on `teams`.`id` = `laravel_reserved_0`.`team_id`
      where `users`.`id` = `teams`.`owner_id`
    )
    
    # sự thật thì
    select * from `users` where exists (
      select * from `users` as `laravel_reserved_0`
      inner join `teams` on `teams`.`id` = `laravel_reserved_0`.`id`
      where `users`.`id` = `teams`.`owner_id`                    ↑↑↑
    )
  • Sửa truy vấn HasManyThrough với chính cha của nó (#26676)
    class Category extends Model {
        public function subProducts() {
            return $this->hasManyThrough(Product::class, self::class, 'parent_id');
        }
    }
    
    Category::has('subProducts')->get();​
    # kết quả mong đợi
    select * from `categories` where exists (
      select * from `products`
      inner join `categories` as `laravel_reserved_0`
      on `laravel_reserved_0`.`id` = `products`.`category_id`
      where `categories`.`id` = `laravel_reserved_0`.`parent_id`
    )
    
    # sự thật thì...
    select * from `categories` where exists (
      select * from `products`
      inner join `categories`
      on `categories`.`id` = `products`.`category_id`
      where `categories`.`id` = `categories`.`parent_id`
    )
  • Sửa lỗi eager loading bị break với "incrementing" string keys (#26688)
  • Bỏ liên kết đến trang đăng ký khi route đăng ký không tồn tại app.stub (#26708)
  • Sửa phương thức Collection::some (#26696)
  • Revert breaking change in TestResponse::decodeResponseJson method (#26713)
  • Sửa PhpRedisConnection::mget (#26716)
  • Sửa Eloquent\Collection::loadCount attribute syncing (#26714)
  • Sửa Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase::seed for array accepting (#26734)
  • Sửa lỗi FormRequest validation kích hoạt 2 lần (#26731)

Thay đổi

  • Đổi class từ sm sang md trong auth stub view (Auth/Console/stubs/make/views/auth/login.stub) (#26648)
  • Chuyển Slack và Nexmo notification channels thành package của Laravel laravel/nexmo-notification-channellaravel/slack-notification-channel (#26689#26727)

Loại bỏ

  • Thuộc tính $cachedSchema trong UrlGenerator được loại bỏ. Sẽ đổi tên thành $cachedScheme trong Laravel 5.8 (#26640)

Đánh giá bài viết

Thích thì like
Ra mắt Laravel 5.7.16
5/5 1 votes

Bình luận

Hiển thị bình luận Facebook