CINXE.COM

Asymmetric Property Visibility in PHP 8.4 - Laravel News

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="csrf-token" content="0zZsVqaSSFbozsoa1ZXARYftKBUQoquLN2EqP38s"/> <title>Asymmetric Property Visibility in PHP 8.4 - Laravel News</title> <meta name="description" content="Starting in PHP 8.4, properties may also have their visibility set asymmetrically with a different scope for reading and writing. Learn how to use this exciting feature coming to PHP!" /> <meta property="og:type" content="website"/> <meta property="og:title" content="Asymmetric Property Visibility in PHP 8.4 - Laravel News"/> <meta property="og:description" content="Starting in PHP 8.4, properties may also have their visibility set asymmetrically with a different scope for reading and writing. Learn how to use this exciting feature coming to PHP!" /> <meta property="og:type" content="website"/> <meta property="og:title" content="Asymmetric Property Visibility in PHP 8.4 - Laravel News"/> <meta property="og:image" content="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/asymmetric-property-php-84-featured.png" /> <meta property="og:description" content="Starting in PHP 8.4, properties may also have their visibility set asymmetrically with a different scope for reading and writing. Learn how to use this exciting feature coming to PHP!" /> <meta property="og:url" content="https://laravel-news.com/asymmetric-property-visibility-in-php-84"/> <meta property="og:site_name" content="Laravel News"/> <meta property="og:locale" content="en_US"/> <meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:site" content="@laravelnews"/> <meta name="twitter:title" content="Asymmetric Property Visibility in PHP 8.4 - Laravel News"/> <meta property="twitter:image" content="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/asymmetric-property-php-84-featured.png" /> <meta name="twitter:description" content="Starting in PHP 8.4, properties may also have their visibility set asymmetrically with a different scope for reading and writing. Learn how to use this exciting feature coming to PHP!" /> <meta name="twitter:creator" content="@paulredmond"/> <link href="https://laravel-news.com/asymmetric-property-visibility-in-php-84" rel="canonical"/> <link href="https://laravel-news.com/" rel="home"/> <link rel="alternate" type="application/rss+xml" title="Laravel News &raquo; Feed" href="https://feed.laravel-news.com/" /> <link rel="alternate" title="Laravel News Feed" type="application/json" href="https://laravel-news.com/feed/json" /> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/> <link rel="manifest" href="/site.webmanifest"/> <meta property="fb:admins" content="100007722642618"/> <meta property="fb:app_id" content="440569919467159"/> <link rel="preconnect" href="https://use.typekit.net"/> <link rel="stylesheet" href="https://use.typekit.net/ltt3ltm.css"/> <link rel="preconnect" href="https://fonts.bunny.net"/> <link href="https://fonts.bunny.net/css?family=jetbrains-mono:400,400i" rel="stylesheet"/> <script src="https://cdn.usefathom.com/script.js" data-site="BYASFNCM" defer></script> <meta property="fb:admins" content="100007722642618"/> <meta property="fb:app_id" content="440569919467159"/> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-LE9GHTERHJ"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-LE9GHTERHJ'); </script> <!-- Meta Pixel Code --> <script> !(function (f, b, e, v, n, t, s) { if (f.fbq) return; n = f.fbq = function () { n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments); }; if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0'; n.queue = []; t = b.createElement(e); t.async = !0; t.src = v; s = b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t, s); })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '1570328566617363'); fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" style="display: none" src="https://www.facebook.com/tr?id=1570328566617363&ev=PageView&noscript=1" /> </noscript> <!-- End Meta Pixel Code --> <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script> <link rel="preload" as="style" href="https://laravel-news.com/build/assets/app-cee40202.css" /><link rel="modulepreload" href="https://laravel-news.com/build/assets/app-83314634.js" /><link rel="stylesheet" href="https://laravel-news.com/build/assets/app-cee40202.css" data-navigate-track="reload" /><script type="module" src="https://laravel-news.com/build/assets/app-83314634.js" data-navigate-track="reload"></script> <!-- Livewire Styles --><style >[wire\:loading][wire\:loading], [wire\:loading\.delay][wire\:loading\.delay], [wire\:loading\.inline-block][wire\:loading\.inline-block], [wire\:loading\.inline][wire\:loading\.inline], [wire\:loading\.block][wire\:loading\.block], [wire\:loading\.flex][wire\:loading\.flex], [wire\:loading\.table][wire\:loading\.table], [wire\:loading\.grid][wire\:loading\.grid], [wire\:loading\.inline-flex][wire\:loading\.inline-flex] {display: none;}[wire\:loading\.delay\.none][wire\:loading\.delay\.none], [wire\:loading\.delay\.shortest][wire\:loading\.delay\.shortest], [wire\:loading\.delay\.shorter][wire\:loading\.delay\.shorter], [wire\:loading\.delay\.short][wire\:loading\.delay\.short], [wire\:loading\.delay\.default][wire\:loading\.delay\.default], [wire\:loading\.delay\.long][wire\:loading\.delay\.long], [wire\:loading\.delay\.longer][wire\:loading\.delay\.longer], [wire\:loading\.delay\.longest][wire\:loading\.delay\.longest] {display: none;}[wire\:offline][wire\:offline] {display: none;}[wire\:dirty]:not(textarea):not(input):not(select) {display: none;}:root {--livewire-progress-bar-color: #2299dd;}[x-cloak] {display: none !important;}</style> </head> <body class="antialised min-h-screen bg-white font-sans text-black"> <div x-persist="header"> <header x-data="{ mobileMenuIsOpen: false, searchModalIsOpen: false, init() { document.addEventListener('livewire:navigating', () => { this.mobileMenuIsOpen = false; this.searchModalIsOpen = false; }); }, }" class="absolute inset-x-0 top-0 z-10" > <div class="flex items-center justify-center bg-red-600 p-2 text-center text-sm text-white"> <div wire:snapshot="{&quot;data&quot;:[],&quot;memo&quot;:{&quot;id&quot;:&quot;7kGpD85LXxWlGPs7sFUq&quot;,&quot;name&quot;:&quot;components.top-ad&quot;,&quot;path&quot;:&quot;asymmetric-property-visibility-in-php-84&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;children&quot;:[],&quot;scripts&quot;:[],&quot;assets&quot;:[],&quot;errors&quot;:[],&quot;locale&quot;:&quot;en&quot;},&quot;checksum&quot;:&quot;4d1a3f1d1de62c17dcfa490d348de1628d31fd5dac78da3cf1686393823669d6&quot;}" wire:effects="[]" wire:id="7kGpD85LXxWlGPs7sFUq"> <!--[if BLOCK]><![endif]--> <p onclick="fathom.trackGoal('UPKMRAIG', 0);"> <a href="https://www.bacancytechnology.com/hire-laravel-developer?utm_source=laravel-news&utm_medium=top-banner&utm_campaign=partner">Outsource Laravel Development Partner - $2500/Month | Bacancy</a> </p> <!--[if ENDBLOCK]><![endif]--> </div> </div> <div class="mx-auto flex w-full max-w-7xl items-center justify-between gap-4 px-6 py-6 md:gap-8 md:py-10" > <div class="xl:gap-18 flex items-center gap-16"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 hover:-translate-y-1 hover:opacity-70 focus-visible:ring-offset-2" href="/" wire:navigate.hover > <img class="lg:h-18 lg:w-18 h-12 w-12 sm:h-16 sm:w-16" width="87" height="86" src="https://picperf.io/https://laravel-news.com/images/logo.svg" alt="Laravel News" /> <span class="sr-only">Laravel News</span> </a> <div class="hidden items-center gap-4 sm:flex md:gap-8"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/blog" wire:navigate.hover > Blog </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/category/tutorials" wire:navigate.hover > Tutorials </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/category/packages" wire:navigate.hover > Packages </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 !hidden p-1 font-bold hover:text-gray-600 md:!inline-flex" href="/newsletter" wire:navigate.hover > Newsletter </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 !hidden p-1 font-bold hover:text-gray-600 md:!inline-flex" href="https://podcast.laravel-news.com/" > Podcast </a> </div> </div> <div class="xl:gap-18 flex items-center gap-16"> <div class="hidden items-center gap-4 md:gap-8 lg:flex"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/partners" wire:navigate.hover > Partners </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/links" wire:navigate.hover > Links </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/login" wire:navigate.hover > Your Account </a> </div> <div class="-mr-1 flex items-center gap-2"> <button class="inline-flex rounded-sm p-1 leading-none text-black transition duration-300 hover:text-gray-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 focus-visible:ring-offset-4 focus-visible:ring-offset-white" @click.prevent="searchModalIsOpen = true" > <img src="https://picperf.io/https://laravel-news.com/images/icons/search.svg" class="h-6 w-6" alt="Search" /> <span class="sr-only">Search</span> </button> <button class="inline-flex rounded-sm p-1 leading-none text-black transition duration-300 hover:text-gray-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 focus-visible:ring-offset-4 focus-visible:ring-offset-white lg:hidden" @click.prevent="mobileMenuIsOpen = true" > <img src="https://picperf.io/https://laravel-news.com/images/icons/menu.svg" class="h-6 w-6" alt="Menu" /> <span class="sr-only">Menu</span> </button> </div> </div> </div> <template x-teleport="body"> <div x-dialog x-model="mobileMenuIsOpen" x-cloak class="fixed inset-0 z-50 overflow-hidden lg:hidden" > <div x-dialog:overlay x-transition.opacity class="fixed inset-0 bg-black/50"></div> <div class="fixed inset-y-0 right-0 w-full max-w-lg"> <div x-dialog:panel x-transition:enter="transition duration-300 ease-out" x-transition:enter-start="translate-x-full" x-transition:enter-end="translate-x-0" x-transition:leave="transition duration-300 ease-in" x-transition:leave-start="translate-x-0" x-transition:leave-end="translate-x-full" class="h-full w-full" > <div class="flex h-full flex-col justify-between overflow-y-auto bg-white shadow-card" > <div class="p-6 md:p-10"> <div class="flex items-center justify-between"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 hover:-translate-y-1 hover:opacity-70 focus-visible:ring-offset-2" href="/" wire:navigate.hover > <img class="h-12 w-12 sm:h-16 sm:w-16" width="87" height="86" src="https://picperf.io/https://laravel-news.com/images/logo.svg" alt="Laravel News" /> <h2 x-dialog:title class="sr-only">Laravel News</h2> </a> <button type="button" @click="$dialog.close()" class="rounded-sm p-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 focus-visible:ring-offset-4" > <span class="sr-only">Close menu</span> <img src="https://picperf.io/https://laravel-news.com/images/icons/close.svg" class="h-6 w-6" alt="Close menu" /> </button> </div> <div class="-mx-1 mt-12 flex flex-col gap-4"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/blog" wire:navigate.hover > Blog </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/category/tutorials" wire:navigate.hover > Tutorials </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/category/packages" wire:navigate.hover > Packages </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="https://podcast.laravel-news.com/" > Podcast </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/newsletter" wire:navigate.hover > Newsletter </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/links" wire:navigate.hover > Community Links </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/partners" wire:navigate.hover > Partners </a> <div class="px-1 py-3"> <hr class="border-gray-600/30" /> </div> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/login" wire:navigate.hover > Your Account </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 hover:text-gray-600" href="/advertising" wire:navigate.hover > Advertising </a> </div> </div> </div> </div> </div> </div> </template> <template x-teleport="body"> <div x-data="{ initialized: false, init() { $watch('searchModalIsOpen', (value) => { if (! this.initialized) { search.start(); this.initialized = true; } if (value) { setTimeout(() => { this.$el.querySelector('input').focus(); }, 100); } }); }, }" x-dialog x-model="searchModalIsOpen" x-cloak class="fixed inset-0 z-10" @keydown.slash.meta.window="searchModalIsOpen = !searchModalIsOpen" @keydown.k.meta.window="searchModalIsOpen = !searchModalIsOpen" @keydown.escape.window="searchModalIsOpen = false" > <div x-dialog:overlay x-transition.opacity class="fixed inset-0 bg-black/60 backdrop-blur-sm" ></div> <div class="relative flex min-h-screen items-center justify-center p-4"> <div x-dialog:panel x-transition.opacity.duration.400ms class="relative h-[88vh] w-full max-w-3xl overflow-y-auto rounded-lg border border-gray-100 bg-white shadow-card" > <div class="p-6 lg:p-12"> <div class="flex items-center justify-between gap-4"> <h2 x-dialog:title class="text-2xl font-bold">Search Articles</h2> <button type="button" @click="$dialog.close()" class="rounded-sm p-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 focus-visible:ring-offset-4" > <span class="sr-only">Close search</span> <img src="https://picperf.io/https://laravel-news.com/images/icons/close.svg" class="h-6 w-6" alt="Close menu" /> </button> </div> <div class="ais-InstantSearch mt-10"> <div id="searchbox"></div> <div id="hits"></div> <div class="mt-1 border-gray-200 border-t"> <p class="mt-4"> Or try <a href="/search" class="focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 font-bold text-red-600 hover:text-red-700"> paginated search → </a> </p> </div> </div> </div> </div> </div> </div> </template> </header> </div> <div> <div wire:snapshot="{&quot;data&quot;:{&quot;article&quot;:[null,{&quot;class&quot;:&quot;App\\Models\\Article&quot;,&quot;key&quot;:3750,&quot;s&quot;:&quot;mdl&quot;}]},&quot;memo&quot;:{&quot;id&quot;:&quot;QgApEWYgH2HwIAYCao57&quot;,&quot;name&quot;:&quot;article-show&quot;,&quot;path&quot;:&quot;asymmetric-property-visibility-in-php-84&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;children&quot;:{&quot;lw-4166517266-0&quot;:[&quot;div&quot;,&quot;LXxn4TsE7KCcdcmzmuzM&quot;],&quot;lw-3915564124-0&quot;:[&quot;div&quot;,&quot;wWcWsghvPiTeSkRs0W99&quot;],&quot;lw-3915564124-1&quot;:[&quot;section&quot;,&quot;uXgqAtDvTbSVHBnR5KTh&quot;],&quot;lw-3915564124-2&quot;:[&quot;section&quot;,&quot;YXruE64NBELgV7VSuDUi&quot;]},&quot;scripts&quot;:[],&quot;assets&quot;:[],&quot;errors&quot;:[],&quot;locale&quot;:&quot;en&quot;},&quot;checksum&quot;:&quot;79ff76898531a452b75258871eafd1ceb37f97b655388dc8adc80de36aad7550&quot;}" wire:effects="[]" wire:id="QgApEWYgH2HwIAYCao57"> <link rel="preload" fetchpriority="high" as="image" href="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/asymmetric-property-php-84-featured.png" /> <article> <div class="relative bg-gradient-to-r from-gray-100 to-white"> <div class="h-[160px] sm:h-[148px] md:h-[180px]"></div> <div class="absolute inset-x-0 bottom-0 h-1/4 w-full bg-white"></div> <div class=" relative mx-auto w-full max-w-4xl px-6 pt-10" > <h1 class="text-4xl font-bold sm:text-5xl md:text-6xl">Asymmetric Property Visibility in PHP 8.4</h1> <div class="mt-6 flex items-center gap-3"> <p class="text-xs text-gray-600"> Last updated on <time itemprop="dateModified" datetime="2024-11-19T20:21:54" > November 19th, 2024 </time> by <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 hover:text-red-600" href="/@paulredmond" rel="author" wire:navigate.hover > Paul Redmond </a> </p> </div> <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/asymmetric-property-php-84-featured.png" alt="Asymmetric Property Visibility in PHP 8.4 image" class="mt-12 aspect-[2/1] w-full overflow-hidden rounded-xl object-cover shadow-card" /> </div> </div> <div class="mx-auto w-full max-w-4xl px-6 py-20"> <div class="prose max-w-4xl break-words prose-a:text-red-600 prose-a:transition prose-a:hover:text-red-700 prose-pre:rounded-lg prose-pre:bg-gray-100/50 prose-pre:p-6 prose-img:mx-auto prose-img:rounded-lg prose-img:border prose-img:border-gray-100" > <p>PHP 8.4 is scheduled to be released tomorrow, and one exciting feature we haven't covered yet is <strong>Asymmetric Property Visibility</strong>. Starting in PHP 8.4, properties may also have their visibility set asymmetrically with a different scope for reading and writing. Here's an example from the <a href="https://www.php.net/manual/en/language.oop5.visibility.php#language.oop5.visibility-members-aviz">documentation</a>:</p> <pre><code data-theme="github-light" data-lang="php" class='torchlight' style='background-color: #fff; --theme-selection-background: #e2e5e9;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #D73A49;">class</span><span style="color: #24292E;"> </span><span style="color: #6F42C1;">Book</span></div><div class='line'><span style="color: #24292E;">{</span></div><div class='line'><span style="color: #24292E;"> </span><span style="color: #D73A49;">public</span><span style="color: #24292E;"> </span><span style="color: #D73A49;">function</span><span style="color: #24292E;"> </span><span style="color: #005CC5;">__construct</span><span style="color: #24292E;">(</span></div><div class='line'><span style="color: #24292E;"> public private(set) </span><span style="color: #D73A49;">string</span><span style="color: #24292E;"> $title,</span></div><div class='line'><span style="color: #24292E;"> public protected(set) </span><span style="color: #D73A49;">string</span><span style="color: #24292E;"> $author,</span></div><div class='line'><span style="color: #24292E;"> protected private(set) </span><span style="color: #D73A49;">int</span><span style="color: #24292E;"> $pubYear,</span></div><div class='line'><span style="color: #24292E;"> ) {}</span></div><div class='line'><span style="color: #24292E;">}</span></div><div class='line'>&nbsp;</div><div class='line'><span style="color: #D73A49;">class</span><span style="color: #24292E;"> </span><span style="color: #6F42C1;">SpecialBook</span><span style="color: #24292E;"> </span><span style="color: #D73A49;">extends</span><span style="color: #24292E;"> </span><span style="color: #6F42C1;">Book</span></div><div class='line'><span style="color: #24292E;">{</span></div><div class='line'><span style="color: #24292E;"> </span><span style="color: #D73A49;">public</span><span style="color: #24292E;"> </span><span style="color: #D73A49;">function</span><span style="color: #24292E;"> </span><span style="color: #6F42C1;">update</span><span style="color: #24292E;">(</span><span style="color: #D73A49;">string</span><span style="color: #24292E;"> $author, </span><span style="color: #D73A49;">int</span><span style="color: #24292E;"> $year)</span><span style="color: #D73A49;">:</span><span style="color: #24292E;"> </span><span style="color: #D73A49;">void</span></div><div class='line'><span style="color: #24292E;"> {</span></div><div class='line'><span style="color: #24292E;"> </span><span style="color: #005CC5;">$this</span><span style="color: #D73A49;">-&gt;</span><span style="color: #24292E;">author </span><span style="color: #D73A49;">=</span><span style="color: #24292E;"> $author; </span><span style="color: #6A737D;">// OK</span></div><div class='line'><span style="color: #24292E;"> </span><span style="color: #005CC5;">$this</span><span style="color: #D73A49;">-&gt;</span><span style="color: #24292E;">pubYear </span><span style="color: #D73A49;">=</span><span style="color: #24292E;"> $year; </span><span style="color: #6A737D;">// Fatal Error</span></div><div class='line'><span style="color: #24292E;"> }</span></div><div class='line'><span style="color: #24292E;">}</span></div><div class='line'>&nbsp;</div><div class='line'><span style="color: #24292E;">$b </span><span style="color: #D73A49;">=</span><span style="color: #24292E;"> </span><span style="color: #D73A49;">new</span><span style="color: #24292E;"> </span><span style="color: #005CC5;">Book</span><span style="color: #24292E;">(</span><span style="color: #032F62;">&#39;How to PHP&#39;</span><span style="color: #24292E;">, </span><span style="color: #032F62;">&#39;Peter H. Peterson&#39;</span><span style="color: #24292E;">, </span><span style="color: #005CC5;">2024</span><span style="color: #24292E;">);</span></div><div class='line'>&nbsp;</div><div class='line'><span style="color: #005CC5;">echo</span><span style="color: #24292E;"> $b</span><span style="color: #D73A49;">-&gt;</span><span style="color: #24292E;">title; </span><span style="color: #6A737D;">// How to PHP</span></div><div class='line'><span style="color: #005CC5;">echo</span><span style="color: #24292E;"> $b</span><span style="color: #D73A49;">-&gt;</span><span style="color: #24292E;">author; </span><span style="color: #6A737D;">// Peter H. Peterson</span></div><div class='line'><span style="color: #005CC5;">echo</span><span style="color: #24292E;"> $b</span><span style="color: #D73A49;">-&gt;</span><span style="color: #24292E;">pubYear; </span><span style="color: #6A737D;">// Fatal Error</span></div></code></pre> <p>Providing public access to a property but preventing a <code>(set)</code> publicly is illustrated in how both <code>$title</code> and <code>$author</code> can be accessed publicly. However, you can see granular control is how these properties can be set (protected or private). Class properties must have a type to set a separate visiblity, and <code>set</code> must be the same or more restrictive than <code>get</code>.</p> <p>Follow our <a href="https://laravel-news.com/php-8-4-0">PHP 8.4</a> post to get updates as PHP 8.4 is released on November 21st!</p> </div> <div class="mt-12"> <div class="flex flex-col items-start space-y-4 sm:flex-row sm:space-x-6 sm:space-y-0"> <img class="h-20 w-20 rounded-lg object-cover" src="https://www.gravatar.com/avatar/d9691184a54bfa1defe3dc7d625bc959?s=200" alt="Paul Redmond photo" /> <div> <p class="font-display text-2xl font-bold leading-none text-black" itemprop="author"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80" href="/@paulredmond" rel="author" wire:navigate.hover > Paul Redmond </a> </p> <div class="prose prose-sm mt-2 text-gray-600 prose-a:text-red-600 prose-a:transition prose-a:hover:text-red-700" > <p>Staff writer at Laravel News. Full stack web developer and author.</p> </div> <div class="mt-4 flex gap-2"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 inline-flex h-5 w-5 items-center justify-center !rounded-full hover:opacity-80" href="https://twitter.com/paulredmond" target="_blank" rel="noopener noreferrer" > <img class="h-4 w-4" src="https://picperf.io/https://laravel-news.com/images/x.svg" loading="lazy" alt="X" /> <span class="sr-only">X</span> </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 inline-flex h-5 w-5 items-center justify-center !rounded-full hover:opacity-80" href="https://github.com/paulredmond" target="_blank" rel="noopener noreferrer" > <img class="h-4 w-4" src="https://picperf.io/https://laravel-news.com/images/github.svg" loading="lazy" alt="GitHub" /> <span class="sr-only">GitHub</span> </a> </div> </div> </div> </div> <div class="mt-6 flex flex-wrap items-center gap-x-3 gap-y-2"> <span class="text-gray-600">Filed in:</span> <div class="flex flex-wrap items-center gap-x-2 gap-y-2"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 inline-flex !rounded-full px-4 py-2 text-xs font-bold leading-4 hover:opacity-80 focus-visible:ring-offset-1 bg-red-600 text-white" href="/category/news" wire:navigate.hover > News </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 inline-flex !rounded-full px-4 py-2 text-xs font-bold leading-4 hover:opacity-80 focus-visible:ring-offset-1 bg-red-600 text-white" href="/tag/php" wire:navigate.hover > Php </a> </div> </div> </div> </article> <div class="mx-auto max-w-4xl px-6 pb-32 pt-10"> <div class="relative"> <img delay="1500" class="absolute -top-10 right-16 z-10 lg:-top-6 lg:left-1/3 lg:right-auto" x-data="{ initializeAnimation: false, init() { setTimeout(() => { this.initializeAnimation = true; }, 1500); }, }" :class="initializeAnimation ? 'animate-cube' : ''" src="https://picperf.io/https://laravel-news.com/images/cube.svg" alt="Cube" /> <div class="relative flex flex-wrap items-center justify-between gap-8 overflow-hidden rounded-lg border border-gray-100 bg-white p-8 shadow-card lg:flex-nowrap" > <span class="absolute inset-y-0 left-0 w-1 bg-red-600"></span> <div> <h2 class="text-2xl font-bold sm:text-3xl">Laravel Newsletter</h2> <p class="mt-1 text-gray-600"> Join 40k+ other developers and never miss out on new tips, tutorials, and more. </p> </div> <div class="lg:shrink-0"> <div wire:snapshot="{&quot;data&quot;:{&quot;email&quot;:null,&quot;submitted&quot;:false,&quot;failed&quot;:false,&quot;location&quot;:&quot;article&quot;},&quot;memo&quot;:{&quot;id&quot;:&quot;LXxn4TsE7KCcdcmzmuzM&quot;,&quot;name&quot;:&quot;newsletter-signup&quot;,&quot;path&quot;:&quot;asymmetric-property-visibility-in-php-84&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;children&quot;:[],&quot;scripts&quot;:[],&quot;assets&quot;:[],&quot;errors&quot;:[],&quot;locale&quot;:&quot;en&quot;},&quot;checksum&quot;:&quot;e6000f25e15f23c0696b469c764d74fed8b8f6401f18cba3b224712806e0e595&quot;}" wire:effects="[]" wire:id="LXxn4TsE7KCcdcmzmuzM"> <form wire:submit="submit"> <div class="flex w-full flex-wrap items-stretch gap-4"> <label class="relative flex min-w-[240px] flex-1 items-center bg-white"> <span class="sr-only">Email</span> <img src="https://picperf.io/https://laravel-news.com/images/icons/newsletter.svg" alt="Newsletter icon" class="pointer-events-none absolute left-3 top-3" /> <input wire:model="email" type="text" class="w-full rounded-lg border-gray-100 bg-transparent px-12 py-3 text-gray-600 placeholder-gray-600/50 transition focus:border-gray-100 focus:bg-gray-100/40 focus:outline-none focus:ring-2 focus:ring-red-600/80 focus:ring-offset-2" placeholder="Email" /> </label> <button type="submit" class="inline-flex items-center justify-center leading-none bg-red-600 border border-transparent rounded-lg font-bold text-base text-white hover:bg-red-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 focus-visible:ring-offset-2 disabled:bg-red-600/50 disabled:cursor-not-allowed transition ease-in-out duration-300 px-6 py-4" > Join free </button> </div> </form> </div> </div> </div> </div> <div class="mt-10"> <div wire:snapshot="{&quot;data&quot;:[],&quot;memo&quot;:{&quot;id&quot;:&quot;wWcWsghvPiTeSkRs0W99&quot;,&quot;name&quot;:&quot;components.larajobs-card&quot;,&quot;path&quot;:&quot;asymmetric-property-visibility-in-php-84&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;children&quot;:[],&quot;scripts&quot;:[],&quot;assets&quot;:[],&quot;errors&quot;:[],&quot;locale&quot;:&quot;en&quot;},&quot;checksum&quot;:&quot;f224193229857530ba70f2afeab3b57176abf624d856e09bd0be2f03abd67913&quot;}" wire:effects="[]" wire:id="wWcWsghvPiTeSkRs0W99" class="relative flex justify-between rounded-lg bg-white border border-gray-100 shadow-card"> <img delay="0" class="absolute left-0 top-3 -translate-x-1/2" x-data="{ initializeAnimation: false, init() { setTimeout(() => { this.initializeAnimation = true; }, 0); }, }" :class="initializeAnimation ? 'animate-cube' : ''" src="https://picperf.io/https://laravel-news.com/images/cube.svg" alt="Cube" /> <div class="px-8 py-12 lg:p-12"> <h2 class="text-3xl font-bold">Laravel Jobs</h2> <p class="mt-2 text-gray-600">Explore hundreds of open positions today.</p> <a href="https://larajobs.com" class="mt-6 inline-flex items-center px-6 py-4 leading-none bg-black border border-transparent rounded-lg font-bold text-base text-white hover:bg-gray-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 focus-visible:ring-offset-2 transition ease-in-out duration-300"> View all jobs </a> </div> <div class="hidden flex-col gap-1 overflow-hidden py-2 sm:flex relative"> <div class="w-56 translate-x-6 rounded-lg border border-gray-100 px-4 py-3 text-xs font-bold shadow-sm truncate" > <a href="https://larajobs.com/job/3445?ref=laravelnews&utm_source=laravelnews&utm_medium=referral"> Sr Angular &amp; Laravel Developer </a> </div> <div class="w-56 translate-x-6 rounded-lg border border-gray-100 px-4 py-3 text-xs font-bold shadow-sm truncate" > <a href="https://larajobs.com/job/3447?ref=laravelnews&utm_source=laravelnews&utm_medium=referral"> Web Application Developer (Laravel) </a> </div> <div class="w-56 translate-x-6 rounded-lg border border-gray-100 px-4 py-3 text-xs font-bold shadow-sm truncate" > <a href="https://larajobs.com/job/3448?ref=laravelnews&utm_source=laravelnews&utm_medium=referral"> Senior Software Engineer </a> </div> <div class="w-56 translate-x-6 rounded-lg border border-gray-100 px-4 py-3 text-xs font-bold shadow-sm truncate" > <a href="https://larajobs.com/job/3446?ref=laravelnews&utm_source=laravelnews&utm_medium=referral"> Senior Laravel Developer - Ambulance Corporate Applications </a> </div> <div class="w-56 translate-x-6 rounded-lg border border-gray-100 px-4 py-3 text-xs font-bold shadow-sm truncate" > <a href="https://larajobs.com/job/3450?ref=laravelnews&utm_source=laravelnews&utm_medium=referral"> Software Developer (Laravel/Vue.js/Tailwind) </a> </div> </div> </div> </div> <div id="iconBarJs"></div> <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7D62JM&placement=laravel-newscom" id="_carbonads_js"></script> </div> <section wire:snapshot="{&quot;data&quot;:{&quot;limited&quot;:false,&quot;levels&quot;:[[&quot;gold&quot;,&quot;silver&quot;],{&quot;s&quot;:&quot;arr&quot;}],&quot;random&quot;:false},&quot;memo&quot;:{&quot;id&quot;:&quot;uXgqAtDvTbSVHBnR5KTh&quot;,&quot;name&quot;:&quot;partners-section&quot;,&quot;path&quot;:&quot;asymmetric-property-visibility-in-php-84&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;children&quot;:[],&quot;scripts&quot;:[],&quot;assets&quot;:[],&quot;errors&quot;:[],&quot;locale&quot;:&quot;en&quot;},&quot;checksum&quot;:&quot;099e5ff507d3eb807060fcf31a990b6feb02888e50cff5ff626a345cd207dcec&quot;}" wire:effects="[]" wire:id="uXgqAtDvTbSVHBnR5KTh" class="bg-gradient-to-r from-gray-100 to-white py-24 sm:py-32"> <div class="mx-auto w-full max-w-2xl px-6 lg:max-w-7xl"> <div class="flex flex-wrap items-center justify-between gap-x-8 gap-y-3"> <h2 class="text-3xl font-bold sm:text-4xl lg:text-[40px]"> <a href="/partners" class="hover:text-red-600">Partners</a> </h2> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 font-bold text-red-600 hover:text-red-700" href="/partners" wire:navigate.hover > View all &rarr; </a> </div> <div class="mt-12 grid gap-8 md:mt-16 md:grid-cols-2 lg:grid-cols-3"> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-24" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/forgelogo.png" alt="Laravel Forge logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Laravel Forge </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Easily create and manage your servers and deploy your Laravel applications in seconds.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://forge.laravel.com/?utm_campaign=laravel&amp;utm_source=laravelnews" target="_blank" > <span class="sr-only">Laravel Forge</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-27" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/tinkerwell-partner-logo.png" alt="Tinkerwell logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Tinkerwell </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://tinkerwell.app/?utm_source=laravel-news&amp;utm_medium=partner-page&amp;utm_campaign=gold-partner" target="_blank" > <span class="sr-only">Tinkerwell</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-38" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/pupg7U0q2pkgSDtgtsNLXsMQGkDWCPRfsB8OZSv9.svg" alt="No Compromises logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> No Compromises </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://nocompromises.io/?ref=ln-partner" target="_blank" > <span class="sr-only">No Compromises</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-54" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/laravel-idea-logo.jpg" alt="Laravel Idea for PhpStorm logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Laravel Idea for PhpStorm </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Ultimate PhpStorm plugin for Laravel developers, delivering lightning-fast code completion, intelligent navigation, and powerful generation tools to supercharge productivity.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravel-idea.com/?utm_source=laravel-news&amp;utm_medium=refferal&amp;utm_campaign=visit-to-partner" target="_blank" > <span class="sr-only">Laravel Idea for PhpStorm</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-5" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/Kirschbaum-dark.png" alt="Kirschbaum logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Kirschbaum </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Providing innovation and stability to ensure your web application succeeds.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="http://kirschbaumdevelopment.com/" target="_blank" > <span class="sr-only">Kirschbaum</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-7" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/laravel-shift-logo.svg" alt="Shift logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Shift </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravelshift.com/" target="_blank" > <span class="sr-only">Shift</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-15" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/Bacancy_logo_400x100.png" alt="Bacancy logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Bacancy </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise &amp; a risk-free 15-day trial. Schedule a call now!</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://www.bacancytechnology.com/hire-laravel-developer?utm_source=LaravelNews&amp;utm_medium=sponsored&amp;utm_campaign=Visit" target="_blank" > <span class="sr-only">Bacancy</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-18" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/OdrDKurHLQnmj2zRVtckusn2tKNKSggWARoe6nZ4.png" alt="Lucky Media logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Lucky Media </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://www.luckymedia.dev/?utm_campaign=sponsor&amp;utm_source=laravelnews&amp;utm_medium=web" target="_blank" > <span class="sr-only">Lucky Media</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-21" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/ih2xiWKvq3gsqNmsMu03Y7flicLy8nnwjOHL6H1K.png" alt="Lunar: Laravel E-Commerce logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Lunar: Laravel E-Commerce </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://lunarphp.io" target="_blank" > <span class="sr-only">Lunar: Laravel E-Commerce</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-45" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/larajobs-logo.png" alt="LaraJobs logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> LaraJobs </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">The official Laravel job board</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://larajobs.com/" target="_blank" > <span class="sr-only">LaraJobs</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-48" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/qMZ85wCJw4QwTO8pF4Mo2UOUz94WgASnQRKCWB3e.png" alt="SaaSykit: Laravel SaaS Starter Kit logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> SaaSykit: Laravel SaaS Starter Kit </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more. </p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://saasykit.com/?utm_campaign=laravel&amp;utm_source=laravelnews" target="_blank" > <span class="sr-only">SaaSykit: Laravel SaaS Starter Kit</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-57" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/A2KezensfUKVwL042ETDnMhsTrBzxrVjRhaOpuft.png" alt="Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Build your SaaS application in hours. Out-of-the-box multi-tenancy and seamless Stripe integration. Supports subscriptions and one-time purchases, allowing you to focus on building and creating without repetitive setup tasks.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://filamentflow.io?utm_source=laravel_news&amp;utm_medium=link" target="_blank" > <span class="sr-only">Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-61" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/GU1zdqehviIoBnf6JYd3G216Ss7p5KoAc508nnAf.png" alt="JetShip - Laravel Starter Kit logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> JetShip - Laravel Starter Kit </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">A Laravel SaaS Boilerplate and a starter kit built on the TALL stack. It includes authentication, payments, admin panels, and more. Launch scalable apps fast with clean code, seamless deployment, and custom branding.</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://demos.themeselection.com/jetship-laravel-starter-kit/?utm_source=Laravel+News&amp;utm_medium=partner+program" target="_blank" > <span class="sr-only">JetShip - Laravel Starter Kit</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-44" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/recter-logo.png" alt="Rector logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> Rector </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies</p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://getrector.com/hire-team?utm_source=laravel-news&amp;utm_medium=partner&amp;utm_campaign=partner" target="_blank" > <span class="sr-only">Rector</span> </a> </div> <div class="group relative bg-white rounded-lg shadow-card border border-gray-100 p-8 w-full shrink-0 lg:p-12" wire:key="partner-50" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/partners/logos/mongodb.png" alt="MongoDB logo" class="h-10 object-contain object-left-top transition group-hover:opacity-80" height="40" width="300px" loading="lazy" /> <h3 class="sr-only"> MongoDB </h3> <p class="mt-6 text-gray-600 group-hover:opacity-80">Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB&#039;s flexible, modern database can transform your Laravel applications. </p> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/?utm_source=ln" target="_blank" > <span class="sr-only">MongoDB</span> </a> </div> </div> </div> </section> <div class="py-12"> <section wire:snapshot="{&quot;data&quot;:{&quot;except&quot;:[[3750],{&quot;s&quot;:&quot;arr&quot;}],&quot;limit&quot;:6},&quot;memo&quot;:{&quot;id&quot;:&quot;YXruE64NBELgV7VSuDUi&quot;,&quot;name&quot;:&quot;latest-articles-section&quot;,&quot;path&quot;:&quot;asymmetric-property-visibility-in-php-84&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;children&quot;:[],&quot;scripts&quot;:[],&quot;assets&quot;:[],&quot;errors&quot;:[],&quot;locale&quot;:&quot;en&quot;},&quot;checksum&quot;:&quot;62e6dae08d8c379a802c3c6ea2d8747c5ec2e45cf0cdfc17706afc27d29156f6&quot;}" wire:effects="[]" wire:id="YXruE64NBELgV7VSuDUi" class="py-20"> <div class="mx-auto w-full max-w-2xl px-6 lg:max-w-7xl"> <div class="flex flex-wrap items-center justify-between gap-x-8 gap-y-3"> <h2 class="text-3xl font-bold sm:text-4xl lg:text-[40px]">The latest</h2> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 font-bold text-red-600 hover:text-red-700" href="/blog" wire:navigate.hover > View all &rarr; </a> </div> <div class="mt-12 grid gap-x-8 gap-y-12 lg:grid-cols-3"> <div class="group relative" wire:key="latest-laravel-11-34-0"> <div class="aspect-[2/1] w-full rounded-lg bg-gray-100 shadow-card transition group-hover:opacity-80" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/laravel11.jpeg" alt="Access Request Data Fluently in Laravel 11.34 image" class="h-full w-full rounded-lg object-cover" loading="lazy" /> </div> <h3 class="mt-4 text-xl font-bold transition group-hover:text-red-600 sm:text-2xl"> Access Request Data Fluently in Laravel 11.34 </h3> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravel-news.com/laravel-11-34-0" onclick="" > <span class="sr-only">Read article</span> </a> </div> <div class="group relative" wire:key="latest-handling-default-values-in-laravel-request-using-mergeifmissing"> <div class="aspect-[2/1] w-full rounded-lg bg-gray-100 shadow-card transition group-hover:opacity-80" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/mergeifmissing.png" alt="Handling Default Values in Laravel Request using mergeIfMissing image" class="h-full w-full rounded-lg object-cover" loading="lazy" /> </div> <h3 class="mt-4 text-xl font-bold transition group-hover:text-red-600 sm:text-2xl"> Handling Default Values in Laravel Request using mergeIfMissing </h3> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravel-news.com/handling-default-values-in-laravel-request-using-mergeifmissing" onclick="" > <span class="sr-only">Read article</span> </a> </div> <div class="group relative" wire:key="latest-automated-composer-security-audits-in-laravel-with-warden"> <div class="aspect-[2/1] w-full rounded-lg bg-gray-100 shadow-card transition group-hover:opacity-80" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/warden-laravel-featured.png" alt="Automated Composer Security Audits in Laravel with Warden image" class="h-full w-full rounded-lg object-cover" loading="lazy" /> </div> <h3 class="mt-4 text-xl font-bold transition group-hover:text-red-600 sm:text-2xl"> Automated Composer Security Audits in Laravel with Warden </h3> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravel-news.com/automated-composer-security-audits-in-laravel-with-warden" onclick="" > <span class="sr-only">Read article</span> </a> </div> <div class="group relative" wire:key="latest-laravel-cyber-deals-2024"> <div class="aspect-[2/1] w-full rounded-lg bg-gray-100 shadow-card transition group-hover:opacity-80" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/laravelnews-post-blackfriday-2023.webp" alt="Laravel Black Friday Deals image" class="h-full w-full rounded-lg object-cover" loading="lazy" /> </div> <h3 class="mt-4 text-xl font-bold transition group-hover:text-red-600 sm:text-2xl"> Laravel Black Friday Deals </h3> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravel-news.com/laravel-cyber-deals-2024" onclick="" > <span class="sr-only">Read article</span> </a> </div> <div class="group relative" wire:key="latest-build-your-saas-app-in-no-time-with-saasykit"> <div class="aspect-[2/1] w-full rounded-lg bg-gray-100 shadow-card transition group-hover:opacity-80" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/sponsored-post-4.jpg" alt="Build Your SaaS App in No Time with SaaSykit image" class="h-full w-full rounded-lg object-cover" loading="lazy" /> </div> <h3 class="mt-4 text-xl font-bold transition group-hover:text-red-600 sm:text-2xl"> Build Your SaaS App in No Time with SaaSykit </h3> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravel-news.com/build-your-saas-app-in-no-time-with-saasykit" onclick="" > <span class="sr-only">Read article</span> </a> </div> <div class="group relative" wire:key="latest-dynamic-mailer-configuration-in-laravel-with-mailbuild"> <div class="aspect-[2/1] w-full rounded-lg bg-gray-100 shadow-card transition group-hover:opacity-80" > <img src="https://picperf.io/https://laravelnews.s3.amazonaws.com/featured-images/mail-build.png" alt="Dynamic Mailer Configuration in Laravel with Mail::build image" class="h-full w-full rounded-lg object-cover" loading="lazy" /> </div> <h3 class="mt-4 text-xl font-bold transition group-hover:text-red-600 sm:text-2xl"> Dynamic Mailer Configuration in Laravel with Mail::build </h3> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 absolute inset-0 !block h-full w-full !rounded-lg" href="https://laravel-news.com/dynamic-mailer-configuration-in-laravel-with-mailbuild" onclick="" > <span class="sr-only">Read article</span> </a> </div> </div> </div> </section> </div> <div wire:ignore> <script src="//m.servedby-buysellads.com/monetization.custom.js"></script> <script> (function () { if (typeof _bsa !== 'undefined' && _bsa) { _bsa.init('custom', 'CW7D653I', 'placement:laravelnewscom_custom', { target: '#iconBarJs', template: ` <div class="iconBarFlex"> <a href="##statlink##" class="iconBarLink" rel="sponsored noopener" target="_blank" title="##company## — ##tagline##"> <div class="iconBarImage" style="background-color: ##backgroundColor##;"> <img height="30" width="30" src="##image##" alt="##company## logo"> </div> <div class="iconBarText"> <div class="iconBarTagline">##companyTagline##</div> <div class="iconBarDescription">##description##</div> </div> </a> <a href="##ad_via_link##" class="iconBarVia" rel="sponsored noopener" target="_blank">ads via BuySellAds</a> </div> ` } ); } })(); </script> </div> </div> </div> <div x-persist="footer"> <footer class="relative overflow-hidden py-24 sm:py-32"> <svg class="absolute bottom-0 right-0" width="603" height="419" viewBox="0 0 603 419" fill="none" xmlns="http://www.w3.org/2000/svg" > <g opacity=".2" filter="url(#filter0_f_4_553)"> <circle cx="462" cy="462" r="258" fill="#F9332B"/> </g> <defs> <filter id="filter0_f_4_553" x="0" y="0" width="924" height="924" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB" > <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feGaussianBlur stdDeviation="102" result="effect1_foregroundBlur_4_553"/> </filter> </defs> </svg> <div class="relative mx-auto flex w-full max-w-2xl flex-col items-start justify-between gap-x-16 gap-y-12 px-6 lg:max-w-7xl lg:flex-row" > <div class="lg:w-1/2"> <h2 class="text-2xl font-bold lg:text-[28px]">Subscribe to our newsletter</h2> <div class="relative mt-10"> <img delay="1500" class="absolute -top-10 right-48 z-10" x-data="{ initializeAnimation: false, init() { setTimeout(() => { this.initializeAnimation = true; }, 1500); }, }" :class="initializeAnimation ? 'animate-cube' : ''" src="https://picperf.io/https://laravel-news.com/images/cube.svg" alt="Cube" /> <div class="relative overflow-hidden rounded-lg border border-gray-100 bg-white p-8 shadow-card" > <span class="absolute inset-y-0 left-0 w-1 bg-red-600"></span> <div wire:snapshot="{&quot;data&quot;:{&quot;email&quot;:null,&quot;submitted&quot;:false,&quot;failed&quot;:false,&quot;location&quot;:&quot;footer&quot;},&quot;memo&quot;:{&quot;id&quot;:&quot;Gq73I1aCA6uG3pe35bIe&quot;,&quot;name&quot;:&quot;newsletter-signup&quot;,&quot;path&quot;:&quot;asymmetric-property-visibility-in-php-84&quot;,&quot;method&quot;:&quot;GET&quot;,&quot;children&quot;:[],&quot;scripts&quot;:[],&quot;assets&quot;:[],&quot;errors&quot;:[],&quot;locale&quot;:&quot;en&quot;},&quot;checksum&quot;:&quot;b87a79caf9e570f62118e8a08e0ed2d2d52b12bc3269f083fe38f10c45995a76&quot;}" wire:effects="[]" wire:id="Gq73I1aCA6uG3pe35bIe"> <form wire:submit="submit"> <div class="flex w-full flex-wrap items-stretch gap-4"> <label class="relative flex min-w-[240px] flex-1 items-center bg-white"> <span class="sr-only">Email</span> <img src="https://picperf.io/https://laravel-news.com/images/icons/newsletter.svg" alt="Newsletter icon" class="pointer-events-none absolute left-3 top-3" /> <input wire:model="email" type="text" class="w-full rounded-lg border-gray-100 bg-transparent px-12 py-3 text-gray-600 placeholder-gray-600/50 transition focus:border-gray-100 focus:bg-gray-100/40 focus:outline-none focus:ring-2 focus:ring-red-600/80 focus:ring-offset-2" placeholder="Email" /> </label> <button type="submit" class="inline-flex items-center justify-center leading-none bg-red-600 border border-transparent rounded-lg font-bold text-base text-white hover:bg-red-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 focus-visible:ring-offset-2 disabled:bg-red-600/50 disabled:cursor-not-allowed transition ease-in-out duration-300 px-6 py-4" > Join free </button> </div> </form> </div> </div> </div> <div class="mt-10 flex flex-wrap items-center gap-8"> <p class="font-bold">and follow us on</p> <div class="flex flex-wrap items-center gap-2 sm:flex-nowrap"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 h-12 w-12 items-center justify-center !rounded-lg border border-gray-100 bg-white !shadow-sm hover:opacity-60" href="https://www.facebook.com/laravelnews" target="_blank" > <img loading="lazy" src="https://picperf.io/https://laravel-news.com/images/facebook.svg" alt="Facebook" class="h-6 w-6 object-contain" rel="nofollow" /> <span class="sr-only">Facebook</span> </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 h-12 w-12 items-center justify-center !rounded-lg border border-gray-100 bg-white !shadow-sm hover:opacity-60" href="https://instagram.com/laravelnews" > <img loading="lazy" src="https://picperf.io/https://laravel-news.com/images/instagram.svg" alt="Instagram" class="h-6 w-6 object-contain" rel="nofollow" /> <span class="sr-only">Instagram</span> </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 h-12 w-12 items-center justify-center !rounded-lg border border-gray-100 bg-white !shadow-sm hover:opacity-60" href="https://twitter.com/laravelnews" > <img loading="lazy" src="https://picperf.io/https://laravel-news.com/images/x.svg" alt="X" class="h-6 w-6 object-contain" rel="nofollow" /> <span class="sr-only">X</span> </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 h-12 w-12 items-center justify-center !rounded-lg border border-gray-100 bg-white !shadow-sm hover:opacity-60" href="https://www.linkedin.com/company/laravel-news" > <img loading="lazy" src="https://picperf.io/https://laravel-news.com/images/linkedin.svg" alt="Linkedin" class="h-6 w-6 object-contain" rel="nofollow" /> <span class="sr-only">Linkedin</span> </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 h-12 w-12 items-center justify-center !rounded-lg border border-gray-100 bg-white !shadow-sm hover:opacity-60" href="https://t.me/laravelnews" > <img loading="lazy" src="https://picperf.io/https://laravel-news.com/images/telegram.svg" alt="Telegram" class="h-6 w-6 object-contain" rel="nofollow" /> <span class="sr-only">Telegram</span> </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 h-12 w-12 items-center justify-center !rounded-lg border border-gray-100 bg-white !shadow-sm hover:opacity-60" href="https://www.youtube.com/c/Laravel-news" > <img loading="lazy" src="https://picperf.io/https://laravel-news.com/images/youtube.svg" alt="Youtube" class="h-6 w-6 object-contain" rel="nofollow" /> <span class="sr-only">Youtube</span> </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 h-12 w-12 items-center justify-center !rounded-lg border border-gray-100 bg-white !shadow-sm hover:opacity-60" href="https://www.threads.net/@laravelnews" > <img loading="lazy" src="https://picperf.io/https://laravel-news.com/images/threads.svg" alt="Threads" class="h-6 w-6 object-contain" rel="nofollow" /> <span class="sr-only">Threads</span> </a> </div> </div> </div> <div class="grid w-full max-w-sm gap-x-12 gap-y-4 sm:grid-cols-2"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/newsletter" wire:navigate.hover > Laravel Newsletter </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/links" wire:navigate.hover > Laravel Links </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/category/packages" wire:navigate.hover > Laravel Packages </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/category/tutorials" wire:navigate.hover > Laravel Tutorials </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/events" wire:navigate.hover > Laravel Events </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="https://laravel-news.com/popular-laravel-packages" wire:navigate.hover > Popular Packages </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/tag/releases" wire:navigate.hover > Laravel Releases </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/partners" wire:navigate.hover > Partners </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/advertising" wire:navigate.hover > Advertising </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="https://larajobs.com" > Laravel Jobs </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/contact" wire:navigate.hover > Contact Us </a> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 p-1 font-bold hover:text-gray-600" href="/login" wire:navigate.hover > Your account </a> </div> </div> <div class="relative mx-auto mt-20 flex w-full max-w-2xl flex-wrap justify-between gap-x-16 gap-y-12 px-6 lg:max-w-7xl" > <p class="text-sm text-gray-600"> &copy; 2012 - 2024 Laravel News <br/> A division of dotdev inc. </p> <p class="text-sm text-gray-600"> <a class="inline-flex rounded-sm transition duration-300 leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-red-600/80 text-black hover:text-red-600" href="/about" wire:navigate.hover > Colophon / About </a> </p> </div> </footer> </div> <script data-navigate-once="true">window.livewireScriptConfig = {"csrf":"0zZsVqaSSFbozsoa1ZXARYftKBUQoquLN2EqP38s","uri":"\/livewire\/update","progressBar":"","nonce":""};</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10