Skip to content
Tutorial emka
Menu
  • Home
  • Debian Linux
  • Ubuntu Linux
  • Red Hat Linux
Menu

LIMA Hal Baru di Laravel 11? Banyak Berubah dari Laravel 10?

Posted on March 13, 2024

Laravel 11, yang diperkenalkan pada 12 Maret 2024, memperkenalkan sejumlah perbaikan yang dirancang untuk menyederhanakan proses pengembangan web dan memperkuat langkah-langkah keamanan.

Mengapa Anda sebaiknya upgrade ke Laravel 11:

  • Pengurangan kode yang redundan.
  • Maksimalisasi kemampuan PHP 8.2.
  • Penyederhanaan proses deteksi dan penyelesaian bug.
  • Kemudahan penyesuaian pemeriksaan permintaan dalam aplikasi Anda.

Laravel 11: 5 Perubahan Menarik

1. Modifikasi direktori rute

Selama penyiapan proyek, direktori rute hanya akan berisi dua berkas: console.php dan web.php. Rute API tidak akan lagi disertakan secara default; sebaliknya, pengembang dapat memilih menggunakan php artisan install:api, yang akan menghasilkan berkas rute API bersamaan dengan integrasi Laravel Sanctum.

2. Simplifikasi struktur proyek

Folder ‘app’ telah mengalami penyederhanaan signifikan. Kernel HTTP dan Console telah dihapus. Sembilan middleware, yang jarang disesuaikan, sekarang terintegrasi ke dalam kerangka kerja. Penanganan pengecualian tidak lagi ada, dan direktori Providers telah digabungkan menjadi satu penyedia.

3. Laravel Reverb

Laravel Reverb membawa komunikasi WebSocket real-time yang cepat dan scalable langsung ke aplikasi Laravel Anda, serta menyediakan integrasi lancar dengan rangkaian alat siaran acara Laravel yang sudah ada, seperti Laravel Echo.

4. Penyelesaian Bug yang Lebih Mudah

Ada fitur baru yang disebut Dumpable yang memungkinkan Anda memeriksa apa yang sedang salah dalam kode Anda lebih mudah. Anda dapat menggunakannya untuk menghentikan kode Anda dan melihat apa yang terjadi pada setiap titik, yang membantu Anda menemukan dan memperbaiki masalah lebih cepat.

class Stringable implements JsonSerializable, ArrayAccess

{

    use Conditionable, Dumpable, Macroable, Tappable;

    str(‘laravel-11’)->dd();

    str(‘laravel-11’)->dump();

}

5. Modifikasi Penetapan Model

Pada Laravel 11, penetapan model sekarang didefinisikan sebagai sebuah metode daripada properti. Perubahan ini memungkinkan fleksibilitas tambahan, seperti kemampuan untuk langsung memanggil metode lain dari dalam penetapan. Berikut adalah contoh menggunakan AsEnumCollection yang baru diperkenalkan di Laravel 11:

class User extends Model

{

    protected function casts(): array

    {

        return [

            ‘birthdate’ => ‘date’,

            ‘preferences’ => ‘json’,

            ‘settings’ => ‘array’,

        ];

    }

}

Dengan mendefinisikan penetapan sebagai metode, para pengembang sekarang dapat memanfaatkan fungsionalitas yang lebih canggih dalam definisi model mereka.

Recent Posts

  • How to build a high-performance private photo cloud with Immich and TrueNAS SCALE
  • How to Build an Endgame Local AI Agent Setup Using an 8-Node NVIDIA Cluster with 1TB Memory
  • How to Master Windows Event Logs to Level Up Your Cybersecurity Investigations and SOC Career
  • How to Build Ultra-Resilient Databases with Amazon Aurora Global Database and RDS Proxy for Maximum Uptime and Performance
  • How to Build Real-Time Personalization Systems Using AWS Agentic AI to Make Every User Feel Special
  • How to Transform Your Windows 11 Interface into a Sleek and Modern Aesthetic Masterpiece
  • How to Understand Google’s New TPU 8 Series for Massive AI Training and Inference
  • How to Level Up Your PC Gaming Experience with the New Valve Steam Controller and Its Advanced Features
  • Is it Time to Replace Nano? Discover Fresh, the Terminal Text Editor You Actually Want to Use
  • How to Design a Services Like Google Ads
  • How to Fix 0x800ccc0b Outlook Error: Step-by-Step Guide for Beginners
  • How to Fix NVIDIA App Error on Windows 11: Simple Guide
  • How to Fix Excel Formula Errors: Quick Fixes for #NAME
  • How to Clear Copilot Memory in Windows 11 Step by Step
  • How to Show Battery Percentage on Windows 11
  • How to Fix VMSp Service Failed to Start on Windows 10/11
  • How to Fix Taskbar Icon Order in Windows 11/10
  • How to Disable Personalized Ads in Copilot on Windows 11
  • What is the Microsoft Teams Error “We Couldn’t Connect the Call” Error?
  • Why Does the VirtualBox System Service Terminate Unexpectedly? Here is the Full Definition
  • Why is Your Laptop Touchpad Overheating? Here are the Causes and Fixes
  • How to Disable All AI Features in Chrome Using Windows 11 Registry
  • How to Avoid Problematic Windows Updates: A Guide to System Stability
  • What is Microsoft Visual C++ Redistributable and How to Fix Common Errors?
  • What is the 99% Deletion Bug? Understanding and Fixing Windows 11 File Errors
  • Inilah Lima HP Xiaomi Rp1 Jutaan Sudah Punya NFC
  • Apa itu Jabatan Panitera Muda Mahkamah Agung, Berapa Gaji & Tunjangannya 2026?
  • Inilah Kenapa Bisa Ada Sensasi Mencekam di Bangunan Tua
  • Apa itu Pengertian Frontier Market di Dunia Saham?
  • Apa itu Krnl Executor Roblox Mei 2026?
  • How to Automate Your Entire SEO Strategy Using a Swarm of 100 Free AI Agents Working in Parallel
  • How to create professional presentations easily using NotebookLM’s AI power for school projects and beyond
  • How to Master SEO Automation with Google Gemini 3.1 Flash-Lite in Google AI Studio
  • How to create viral AI video ads and complete brand assets using the Claude and Higgsfield MCP integration
  • How to Transform Your Mac Into a Supercharged AI Assistant with Perplexity Personal Computer
  • Apa itu Spear-Phishing via npm? Ini Pengertian dan Cara Kerjanya yang Makin Licin
  • Apa Itu Predator Spyware? Ini Pengertian dan Kontroversi Penghapusan Sanksinya
  • Mengenal Apa itu TONESHELL: Backdoor Berbahaya dari Kelompok Mustang Panda
  • Siapa itu Kelompok Hacker Silver Fox?
  • Apa itu CVE-2025-52691 SmarterMail? Celah Keamanan Paling Berbahaya Tahun 2025
©2026 Tutorial emka | Design: Newspaperly WordPress Theme