algolia search

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

Ra mắt Laravel 5.7.14

Ra mắt Laravel 5.7.14


Có gì mới trong Laravel 5.7.14

Hỗ trợ CDN asset url

Trong file config/app.php giờ đây bạn có thể thêm một key mới đó là asset_url

Ví dụ

<?php

return [
    ...
    'asset_url' => 'https://chungnguyen.cloudimage.io',
    ...
];

thì khi gọi asset('logo.jpg') sẽ ra https://chungnguyen.cloudimage.io/logo.jpg thay vì https://chungnguyen.xyz/logo.jpg

Vô hiệu hóa Reset route

Hiện tại Laravel hỗ trợ disable route đăng ký và verify email, thì giờ đây Laravel hỗ trợ thêm vô hiệu hóa route reset password

Auth::routes(['reset' => false]);
// hoặc
Route::auth(['reset' => false]);

Xem file: laravel\framework\src\Illuminate\Routing\Router.php line 1147 để biết thêm

Có thể chỉ định TRIES và TIMEOUT trong Notification

Trong class Notification bạn chỉ cần thêm 2 thuộc tính $tries và $timeout là có thể quyết định số lần try và thời gian timeout xử lý notification đó

Xem code mẫu

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class TestNotification extends Notification implements ShouldQueue
{
    use Queueable;

    public $tries = 3; // Max tries

    public $timeout = 15; // Timeout seconds

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
                    ->line('The introduction to the notification.')
                    ->action('Notification Action', url('/'))
                    ->line('Thank you for using our application!');
    }
}

Illuminate\Cookie\CookieJar ⇒ macroable

👉👉👉👉💚👈👈👈👈

Đánh giá bài viết

Thích thì like
Ra mắt Laravel 5.7.14
0/5 0 votes

Bình luận

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