Skip to content
CodingThailand's Blog
CodingThailand's Blog

by โค้ชเอก

  • Home
  • About Me
  • CodingThailand.com
CodingThailand's Blog

by โค้ชเอก

Laravel 5.7 กำลังจะมาครับ

19/08/2018

Laravel 5.7 กำลังจะมาครับ (คงจะมาราวๆ สิ้นเดือน ส.ค.61 นี้) ในเวอร์ชันนี้ก็มีการเปลี่ยนแปลงจากเวอร์ชัน 5.6 บ้างครับ แต่โดยรวมไม่เยอะมากเท่าไหร่ สามารถอัปเกรดกันได้เลย

.
ผมลองสรุปให้คร่าวๆนะครับว่ามีอะไรบ้าง มาดูกันเลย

.
1. Symfony Dump Server

เราสามารถที่จะ log หรือ dump ดูข้อมูลจากการเรียก API ได้ที่ console ครับ หรือจะกำหนด output ในรูปแบบ html ก็ได้

โดยใช้คำสั่ง php artisan dump-server

ดูภาพประกอบได้ที่: http://bit.ly/2MWwicx

.
2.Email Verification

ใน Laravel 5.7 จะมีระบบการยืนยันตัวตนทางอีเมลมาให้เลยครับ เราไม่ต้องเขียนเอง!

ดูคู่มือเพิ่มเติมได้ที่: http://bit.ly/2Pmq0Vm

.
3. Guest User Gates / Policies

ในเวอร์ชันนี้ เราสามารถอนุญาต guest ให้เข้าถึงส่วนต่างๆของ app เราได้โดยไม่ต้อง login ครับ เพียงแค่กำหนดเครื่องหมาย ? เข้าไปที่ User argument

Gate::define(‘update-post’, function (?User $user, Post $post) {
// …
})

.
4. Paginator Links

เราสามารถ custom จำนวน link ของการแบ่งหน้าได้โดยใช้ method onEachSide ยกตัวอย่างเช่น

{{ $paginator->onEachSide(5)->links() }}

.
5. จะมีการยกเลิก or Operator ของ Blade ครับ ให้เปลี่ยนมาใช้เครื่องหมาย ?? (null coalesce) แทน

// Laravel 5.6…
{{ $foo or ‘default’ }}

// Laravel 5.7…
{{ $foo ?? ‘default’ }}

.
6. เมธอด Route::redirect() จะมีเปลี่ยนโค้ด default ของ http status จาก 301 ไปเป็น 302 ครับ!
แต่หากอยากใช้เป็น 301 อยู่ก็สามารถใช้เมธอด permanentRedirect() ได้ครับ

// Return a 302 redirect…
Route::redirect(‘/foo’, ‘/bar’);

// Return a 301 redirect…
Route::redirect(‘/foo’, ‘/bar’, 301);

// Return a 301 redirect…
Route::permanentRedirect(‘/foo’, ‘/bar’);

.
.
จริงๆ ยังมีอีกหลายอย่างนะครับ ลองอ่านเพิ่มเติมได้ที่คู่มือของ Laravel ได้เลย http://bit.ly/2MWADfW

Views: 1138

Laravel 5

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Posts ล่าสุด

  • การใช้งาน Prefetching ใน Next.js
  • 14 ข้อคิด เพื่อการเป็น Developer ที่ดีขึ้น จาก “Lee Robinson”
  • เคยเจอ “TypeError: Cannot read property ‘x’ of undefined” หรือเปล่า
  • บันทึกการเขียนเว็บไซต์ใหม่ในรอบ 10 ปี ย้ายมาใช้ Next.js
  • ทำไมการจัดการ Error ใน JavaScript ถึงเป็นเรื่องท้าทาย?

Recent Comments

    หมวดหมู่

    • .NET
    • AI
    • Android
    • Angular
    • Angular 2
    • Coding
    • CSS
    • Database
    • Editor
    • Flutter
    • Git
    • HTML5
    • Ionic 2
    • Ionic 4
    • Ionic Framwork
    • JavaScript
    • Laravel
    • Laravel 5
    • Next.js
    • Node.js
    • PHP
    • PHP 7
    • Plugins
    • React
    • React Native
    • Template
    • Tools
    • TypeScript
    • UI
    • Uncategorized
    • Vue.js
    • XAMPP
    • Yii
    • คอร์สเรียน
    • แรงบันดาลใจ

    Archives

    • July 2025
    • April 2025
    • November 2024
    • October 2024
    • April 2020
    • February 2020
    • August 2019
    • September 2018
    • August 2018
    • February 2018
    • November 2017
    • October 2017
    • August 2017
    • July 2017
    • April 2017
    • October 2016
    • August 2016
    • May 2016

    Tags

    .NET android Angular Angular 2 Atom Coding Coding Standard CSS CSS 3 Datepicker Express.js extensions Git HTML HTML5 Ionic2 JavaScript Laravel5 laravel 5.5 MariaDB Material Design MySQL Node.js npm PHP PHP7 plugins PouchDB recaptcha Restful sail.js template typescript typscript XAMPP Yii2

    ผู้เยี่ยมชม

    • 0
    • 1,818,191
    • 547,567
    • 1,138
    ©2025 CodingThailand's Blog | WordPress Theme by SuperbThemes