CINXE.COM
Laravel Bootcamp
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Laravel Bootcamp</title> <!-- Primary Meta Tags --> <meta name="title" content="Laravel Bootcamp - Learn the PHP Framework for Web Artisans"> <meta name="description" content="Together let's walk through building and deploying a modern Laravel application from scratch."> <!-- Open Graph / Facebook --> <meta property="og:type" content="website"> <meta property="og:url" content="https://bootcamp.laravel.com/"> <meta property="og:title" content="Laravel Bootcamp - Learn the PHP Framework for Web Artisans"> <meta property="og:description" content="Together let's walk through building and deploying a modern Laravel application from scratch."> <meta property="og:image" content="https://bootcamp.laravel.com/img/og-image.jpg"> <!-- Twitter --> <meta property="twitter:card" content="summary_large_image"> <meta property="twitter:url" content="https://bootcamp.laravel.com/"> <meta property="twitter:title" content="Laravel - Learn the PHP Framework for Web Artisans"> <meta property="twitter:description" content="Together let's walk through building and deploying a modern Laravel application from scratch."> <meta property="twitter:image" content="https://bootcamp.laravel.com/img/og-image.jpg"> <!-- Favicon --> <link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/img/favicon/favicon-16x16.png"> <link rel="manifest" href="/img/favicon/site.webmanifest"> <link rel="mask-icon" href="/img/favicon/safari-pinned-tab.svg" color="#ff2d20"> <link rel="shortcut icon" href="/img/favicon/favicon.ico"> <meta name="msapplication-TileColor" content="#ff2d20"> <meta name="msapplication-config" content="/img/favicon/browserconfig.xml"> <meta name="theme-color" content="#ffffff"> <meta name="color-scheme" content="light"> <!-- Fonts --> <link rel="stylesheet" href="https://use.typekit.net/ins2wgm.css"> <!-- Scripts & Styles --> <link rel="stylesheet" href="https://bootcamp.laravel.com/build/assets/app.1fe37668.css" /><script type="module" src="https://bootcamp.laravel.com/build/assets/app.f1116ac0.js"></script> <!-- Fathom - beautiful, simple website analytics --> <script src="https://cdn.usefathom.com/script.js" data-site="KRRQTWHM" defer></script> <!-- / Fathom --> <script> window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => { if (localStorage.theme === 'system') { if (e.matches) { document.documentElement.classList.add('dark'); } else { document.documentElement.classList.remove('dark'); } } }); function updateTheme() { if (!('theme' in localStorage)) { localStorage.theme = 'system'; } switch (localStorage.theme) { case 'system': if (window.matchMedia('(prefers-color-scheme: dark)').matches) { document.documentElement.classList.add('dark'); } else { document.documentElement.classList.remove('dark'); } document.documentElement.setAttribute('color-theme', 'system'); break; case 'dark': document.documentElement.classList.add('dark'); document.documentElement.setAttribute('color-theme', 'dark'); break; case 'light': document.documentElement.classList.remove('dark'); document.documentElement.setAttribute('color-theme', 'light'); break; } } updateTheme(); </script> </head> <body x-data="{ navIsOpen: false }" class="font-sans text-gray-900 antialiased" > <a id="skip-to-content-link" href="#main-content" class="absolute bg-gray-100 px-4 py-2 top-3 left-3 text-gray-700 shadow-xl" > Skip to content </a> <div class="min-h-screen dark:bg-dark-700"> <div class="relative lg:flex lg:items-start"> <aside id="sidebar" class="min-h-screen hidden fixed top-0 bottom-0 left-0 z-20 h-full w-16 bg-gradient-to-b from-gray-100 to-white transition-all duration-300 overflow-hidden lg:sticky lg:w-80 lg:shrink-0 lg:flex lg:flex-col lg:justify-end lg:items-end 2xl:max-w-lg 2xl:w-full dark:from-dark-800 dark:to-dark-700" > <div class="relative min-h-0 flex-1 flex flex-col xl:w-80"> <a href="/" class="flex items-center py-8 px-4 lg:px-8 xl:px-16"> <img class="w-8 h-8 shrink-0 transition-all duration-300 lg:w-12 lg:h-12" :class="{ 'w-12 h-12': navIsOpen }" src="/img/logomark.min.svg" alt="Laravel" width="50" height="52" > <span class="hidden lg:block ml-4 text-red-500 text-3xl font-medium">Bootcamp</span> </a> <div class="overflow-y-auto overflow-x-hidden px-4 lg:overflow-hidden lg:px-8 xl:px-16"> <nav id="indexed-nav" class="hidden lg:block lg:mt-4"> <div class="docs_sidebar"> <ul> <li> <h2><a id="introduction" href="#introduction" class="heading-permalink" aria-hidden="true" title="Permalink">#</a><a href="/introduction">Introduction</a></h2> </li> <li> <h2><a id="build-chirper-with-blade" href="#build-chirper-with-blade" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Build Chirper with Blade</h2> <ul> <li> <a href="/blade/installation">Installation</a> </li> <li> <a href="/blade/creating-chirps">Creating Chirps</a> </li> <li> <a href="/blade/showing-chirps">Showing Chirps</a> </li> <li> <a href="/blade/editing-chirps">Editing Chirps</a> </li> <li> <a href="/blade/deleting-chirps">Deleting Chirps</a> </li> <li> <a href="/blade/notifications-and-events">Notifications & Events</a> </li> </ul> </li> <li> <h2><a id="build-chirper-with-livewire" href="#build-chirper-with-livewire" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Build Chirper with Livewire</h2> <ul> <li> <a href="/livewire/installation">Installation</a> </li> <li> <a href="/livewire/creating-chirps">Creating Chirps</a> </li> <li> <a href="/livewire/showing-chirps">Showing Chirps</a> </li> <li> <a href="/livewire/editing-chirps">Editing Chirps</a> </li> <li> <a href="/livewire/deleting-chirps">Deleting Chirps</a> </li> <li> <a href="/livewire/notifications-and-events">Notifications & Events</a> </li> </ul> </li> <li> <h2><a id="build-chirper-with-inertia" href="#build-chirper-with-inertia" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Build Chirper with Inertia</h2> <ul> <li> <a href="/inertia/installation">Installation</a> </li> <li> <a href="/inertia/creating-chirps">Creating Chirps</a> </li> <li> <a href="/inertia/showing-chirps">Showing Chirps</a> </li> <li> <a href="/inertia/editing-chirps">Editing Chirps</a> </li> <li> <a href="/inertia/deleting-chirps">Deleting Chirps</a> </li> <li> <a href="/inertia/notifications-and-events">Notifications & Events</a> </li> </ul> </li> <li> <h2><a id="deploying" href="#deploying" class="heading-permalink" aria-hidden="true" title="Permalink">#</a><a href="/deploying">Deploying</a></h2> </li> <li> <h2><a id="conclusion" href="#conclusion" class="heading-permalink" aria-hidden="true" title="Permalink">#</a><a href="/conclusion">Conclusion</a></h2> </li> </ul> </div> </nav> </div> <div class="flex-grow flex flex-col justify-end"> <div class="hidden 2xl:block mb-12 pl-16"> <svg x-data="{ initializeAnimation: false, init() { setTimeout(() => { this.initializeAnimation = true; }, 0); }, }" :class="initializeAnimation ? 'animate-cube' : ''" class="text-red-600 ml-8" width="46" height="53" viewBox="0 0 46 53" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="m23.102 1 22.1 12.704v25.404M23.101 1l-22.1 12.704v25.404" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel"/><path d="m45.202 39.105-22.1 12.702L1 39.105" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel"/><path transform="matrix(.86698 .49834 .00003 1 1 13.699)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.405H0z"/><path transform="matrix(.86698 -.49834 -.00003 1 23.102 26.402)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.405H0z"/><path transform="matrix(.86701 -.49829 .86701 .49829 1 13.702)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.491H0z"/> </svg> <svg x-data="{ initializeAnimation: false, init() { setTimeout(() => { this.initializeAnimation = true; }, 2000); }, }" :class="initializeAnimation ? 'animate-cube' : ''" class="text-red-600 mt-6 ml-32" width="46" height="53" viewBox="0 0 46 53" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="m23.102 1 22.1 12.704v25.404M23.101 1l-22.1 12.704v25.404" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel"/><path d="m45.202 39.105-22.1 12.702L1 39.105" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel"/><path transform="matrix(.86698 .49834 .00003 1 1 13.699)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.405H0z"/><path transform="matrix(.86698 -.49834 -.00003 1 23.102 26.402)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.405H0z"/><path transform="matrix(.86701 -.49829 .86701 .49829 1 13.702)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.491H0z"/> </svg> <svg x-data="{ initializeAnimation: false, init() { setTimeout(() => { this.initializeAnimation = true; }, 1000); }, }" :class="initializeAnimation ? 'animate-cube' : ''" class="text-red-600 mt-12" width="46" height="53" viewBox="0 0 46 53" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="m23.102 1 22.1 12.704v25.404M23.101 1l-22.1 12.704v25.404" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel"/><path d="m45.202 39.105-22.1 12.702L1 39.105" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel"/><path transform="matrix(.86698 .49834 .00003 1 1 13.699)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.405H0z"/><path transform="matrix(.86698 -.49834 -.00003 1 23.102 26.402)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.405H0z"/><path transform="matrix(.86701 -.49829 .86701 .49829 1 13.702)" stroke="currentColor" stroke-width="1.435" stroke-linejoin="bevel" d="M0 0h25.491v25.491H0z"/> </svg> </div> </div> </div> </aside> <header id="header" class="lg:hidden" @keydown.window.escape="navIsOpen = false" @click.away="navIsOpen = false" > <div class="relative mx-auto w-full py-10 bg-white transition duration-200 dark:bg-dark-700"> <div class="mx-auto px-8 sm:px-16 flex items-center justify-between"> <a href="/" class="flex items-center"> <img class="" src="/img/logomark.min.svg" alt="Laravel"> <span class="hidden sm:block ml-5 text-red-500 text-3xl font-medium">Bootcamp</span> </a> <div class="flex-1 flex items-center justify-end"> <button id="header__sun" onclick="toSystemMode()" title="Switch to system theme" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-sun" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <circle cx="12" cy="12" r="4"></circle> <path d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7"></path> </svg> </button> <button id="header__moon" onclick="toLightMode()" title="Switch to light mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z" /> </svg> </button> <button id="header__indeterminate" onclick="toDarkMode()" title="Switch to dark mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z" /> </svg> </button> <button class="ml-2 relative w-10 h-10 p-2 text-red-600 lg:hidden focus:outline-none focus:shadow-outline" aria-label="Menu" @click.prevent="navIsOpen = !navIsOpen"> <svg x-show="! navIsOpen" x-transition.opacity class="absolute inset-0 mt-2 ml-2 w-6 h-6" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg> <svg x-show="navIsOpen" x-transition.opacity x-cloak class="absolute inset-0 mt-2 ml-2 w-6 h-6" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg> </button> </div> </div> <span :class="{ 'shadow-sm': navIsOpen }" class="absolute inset-0 z-20 pointer-events-none"></span> </div> <div x-show="navIsOpen" x-transition:enter="duration-150" x-transition:leave="duration-100 ease-in" x-cloak > <nav x-show="navIsOpen" x-cloak class="absolute w-full transform origin-top shadow-sm z-10" x-transition:enter="duration-150 ease-out" x-transition:enter-start="opacity-0 -translate-y-8 scale-75" x-transition:enter-end="opacity-100 scale-100" x-transition:leave="duration-100 ease-in" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 -translate-y-8 scale-75" > <div class="relative p-8 bg-white docs_sidebar dark:bg-dark-600"> <ul> <li> <h2><a id="introduction" href="#introduction" class="heading-permalink" aria-hidden="true" title="Permalink">#</a><a href="/introduction">Introduction</a></h2> </li> <li> <h2><a id="build-chirper-with-blade" href="#build-chirper-with-blade" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Build Chirper with Blade</h2> <ul> <li> <a href="/blade/installation">Installation</a> </li> <li> <a href="/blade/creating-chirps">Creating Chirps</a> </li> <li> <a href="/blade/showing-chirps">Showing Chirps</a> </li> <li> <a href="/blade/editing-chirps">Editing Chirps</a> </li> <li> <a href="/blade/deleting-chirps">Deleting Chirps</a> </li> <li> <a href="/blade/notifications-and-events">Notifications & Events</a> </li> </ul> </li> <li> <h2><a id="build-chirper-with-livewire" href="#build-chirper-with-livewire" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Build Chirper with Livewire</h2> <ul> <li> <a href="/livewire/installation">Installation</a> </li> <li> <a href="/livewire/creating-chirps">Creating Chirps</a> </li> <li> <a href="/livewire/showing-chirps">Showing Chirps</a> </li> <li> <a href="/livewire/editing-chirps">Editing Chirps</a> </li> <li> <a href="/livewire/deleting-chirps">Deleting Chirps</a> </li> <li> <a href="/livewire/notifications-and-events">Notifications & Events</a> </li> </ul> </li> <li> <h2><a id="build-chirper-with-inertia" href="#build-chirper-with-inertia" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Build Chirper with Inertia</h2> <ul> <li> <a href="/inertia/installation">Installation</a> </li> <li> <a href="/inertia/creating-chirps">Creating Chirps</a> </li> <li> <a href="/inertia/showing-chirps">Showing Chirps</a> </li> <li> <a href="/inertia/editing-chirps">Editing Chirps</a> </li> <li> <a href="/inertia/deleting-chirps">Deleting Chirps</a> </li> <li> <a href="/inertia/notifications-and-events">Notifications & Events</a> </li> </ul> </li> <li> <h2><a id="deploying" href="#deploying" class="heading-permalink" aria-hidden="true" title="Permalink">#</a><a href="/deploying">Deploying</a></h2> </li> <li> <h2><a id="conclusion" href="#conclusion" class="heading-permalink" aria-hidden="true" title="Permalink">#</a><a href="/conclusion">Conclusion</a></h2> </li> </ul> </div> </nav> </div> </header> <section class="flex-1 dark:bg-dark-700"> <span class="hidden dark:hidden fixed -bottom-[350px] ml-[300px] bg-radial-gradient opacity-[.15] pointer-events-none lg:inline-flex w-[800px] h-[600px]"></span> <div class="px-8 sm:px-16 lg:px-24"> <div class="max-w-screen-lg flex flex-col items-end transition-colors dark:border-gray-700 lg:mt-8 lg:flex-row-reverse"> <div class="fixed top-8 hidden lg:flex items-center justify-center"> <button id="header__sun" onclick="toSystemMode()" title="Switch to system theme" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-sun" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <circle cx="12" cy="12" r="4"></circle> <path d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7"></path> </svg> </button> <button id="header__moon" onclick="toLightMode()" title="Switch to light mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z" /> </svg> </button> <button id="header__indeterminate" onclick="toDarkMode()" title="Switch to dark mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z" /> </svg> </button> </div> </div> <section class="pt-8 pb-8 md:pt-16 md:pb-16 flex"> <section class="docs_main flex-1 max-w-full"> <div id="main-content"> <div class="prose dark:prose-invert relative"> <aside class="table-of-contents-sidebar-wrapper not-prose"><aside class="table-of-contents-sidebar not-prose"><h2>On this page</h2><ul class="table-of-contents"> <li> <a href="#updating-our-component">Updating our component</a> </li> <li> <a href="#authorization">Authorization</a> </li> <li> <a href="#testing-it-out">Testing it out</a> </li> </ul></aside></aside> <h1><b>06.</b> Deleting Chirps</h1> <p>Sometimes no amount of editing can fix a message, so let's give our users the ability to delete their Chirps.</p> <p>Hopefully you're starting to get the hang of things now. We think you'll be impressed how quickly we can add this feature.</p> <h2><a id="updating-our-component" href="#updating-our-component" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Updating our component</h2> <p>To get started, let's update our <code>chirp.list</code> Livewire component to have a delete button and add an action to delete the Chirp when the button is clicked:</p> <div class="tabbed-code" data-group="655204be61eaf99ca592616db15810a6"> <div class="tabbed-code-nav"> <button class="tabbed-code-nav-button active" data-tab="Class" onClick="setTab('Class', '655204be61eaf99ca592616db15810a6')">Class</button> <button class="tabbed-code-nav-button" data-tab="Functional" onClick="setTab('Functional', '655204be61eaf99ca592616db15810a6')">Functional</button> </div> <div class="tabbed-code-body"> <div class="code-container active" data-tab="Class"> <div class="code-container-filename">resources/views/livewire/chirps/list.blade.php</div> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight has-add-lines has-diff-lines has-summaries' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #D3423E;"><?php</span></div><details><summary style='cursor: pointer; display: block'><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-start' style='user-select: none; color: #4c5374'></span> <span class='summary-hide-when-open' style='color:#4c5374'>...</span></div></summary><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> App\Models\</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> Illuminate\Database\Eloquent\</span><span style="color: #FFCB8B;">Collection</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> Livewire\Attributes\</span><span style="color: #FFCB8B;">On</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> Livewire\Volt\</span><span style="color: #FFCB8B;">Component</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-end' style='user-select: none; color: #4c5374'></span> </div></details><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #89DDFF;">new</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">class</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">extends</span><span style="color: #BFC7D5;"> </span><span style="color: #A9C77D;">Component</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">{</span></div><details><summary style='cursor: pointer; display: block'><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-start' style='user-select: none; color: #4c5374'></span> <span class='summary-hide-when-open' style='color:#4c5374'>...</span></div></summary><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB8B;">Collection</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirps</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">?</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$editing</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">null</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">mount</span><span style="color: #D9F5DD;">()</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">void</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">getChirps</span><span style="color: #BFC7D5;">();</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> #[On(</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">chirp-created</span><span style="color: #D9F5DD;">'</span><span style="color: #BFC7D5;">)]</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">getChirps</span><span style="color: #D9F5DD;">()</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">void</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">->chirps</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB8B;">Chirp</span><span style="color: #89DDFF;">::</span><span style="color: #82AAFF;">with</span><span style="color: #BFC7D5;">(</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">user</span><span style="color: #D9F5DD;">'</span><span style="color: #BFC7D5;">)</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">latest</span><span style="color: #BFC7D5;">()</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">get</span><span style="color: #BFC7D5;">();</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">edit</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">void</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">->editing</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">getChirps</span><span style="color: #BFC7D5;">();</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> #[On(</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">chirp-edit-canceled</span><span style="color: #D9F5DD;">'</span><span style="color: #BFC7D5;">)]</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> #[On(</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">chirp-updated</span><span style="color: #D9F5DD;">'</span><span style="color: #BFC7D5;">)]</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">disableEditing</span><span style="color: #D9F5DD;">()</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">void</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">->editing</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">null</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">getChirps</span><span style="color: #BFC7D5;">();</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-end' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> } </span></div></details><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">delete</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">void</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">authorize</span><span style="color: #BFC7D5;">(</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">delete</span><span style="color: #D9F5DD;">'</span><span style="color: #BFC7D5;">, </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #BFC7D5;">);</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">delete</span><span style="color: #BFC7D5;">();</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">getChirps</span><span style="color: #BFC7D5;">();</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> } </span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">}; </span><span style="color: #D3423E;">?></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">mt-6 bg-white shadow-sm rounded-lg divide-y</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @foreach ($chirps as $chirp)</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">p-6 flex space-x-2</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:key</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">{{ $chirp->id }}</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">svg</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">xmlns</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">http://www.w3.org/2000/svg</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">h-6 w-6 text-gray-600 -scale-x-100</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">fill</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">none</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">viewBox</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">0 0 24 24</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">currentColor</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke-width</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">2</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">path</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke-linecap</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">round</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke-linejoin</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">round</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">d</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">/></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">svg</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">flex-1</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">flex justify-between items-center</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">span</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">text-gray-800</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->user->name }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">span</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">ml-2 text-sm text-gray-600</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->created_at->format('j M Y, g:i a') }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @unless ($chirp->created_at->eq($chirp->updated_at))</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">text-sm text-gray-600</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">&middot;</span><span style="color: #BFC7D5;"> {{ __('edited') }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endunless</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @if ($chirp->user->is(auth()->user()))</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-dropdown</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">name</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">trigger</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">button</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">svg</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">xmlns</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">http://www.w3.org/2000/svg</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">h-4 w-4 text-gray-400</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">viewBox</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">0 0 20 20</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">fill</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">currentColor</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">path</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">d</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">/></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">svg</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">button</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">name</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">content</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:click</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">edit({{ $chirp->id }})</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {{ __('Edit') }}</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;">></span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:click</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">delete({{ $chirp->id }})</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:confirm</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">Are you sure to delete this chirp?</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;"> </span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {{ __('Delete') }}</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;"> </span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-dropdown</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endif</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">mt-4 text-lg text-gray-900</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->message }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @if ($chirp->is($editing))</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">livewire:chirps.edit</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">:chirp</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">$chirp</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">:key</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">$chirp->id</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> /></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @else</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">mt-4 text-lg text-gray-900</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->message }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endif</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endforeach</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div></code></pre> </div> <div class="code-container" data-tab="Functional"> <div class="code-container-filename">resources/views/livewire/chirps/list.blade.php</div> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight has-add-lines has-diff-lines has-summaries' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #D3423E;"><?php</span></div><details><summary style='cursor: pointer; display: block'><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-start' style='user-select: none; color: #4c5374'></span> <span class='summary-hide-when-open' style='color:#4c5374'>...</span></div></summary><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> App\Models\</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> Livewire\Volt\{</span><span style="color: #FFCB8B;">on</span><span style="color: #BFC7D5;">, </span><span style="color: #FFCB8B;">state</span><span style="color: #BFC7D5;">};</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BEC5D4;">$getChirps</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">fn</span><span style="color: #BFC7D5;"> </span><span style="color: #D9F5DD;">()</span><span style="color: #BFC7D5;"> => </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">->chirps</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB8B;">Chirp</span><span style="color: #89DDFF;">::</span><span style="color: #82AAFF;">with</span><span style="color: #BFC7D5;">(</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">user</span><span style="color: #D9F5DD;">'</span><span style="color: #BFC7D5;">)</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">latest</span><span style="color: #BFC7D5;">()</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">get</span><span style="color: #BFC7D5;">();</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BEC5D4;">$disableEditing</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #D9F5DD;">()</span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">->editing</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">null</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">return</span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">getChirps</span><span style="color: #BFC7D5;">();</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">};</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #82AAFF;">state</span><span style="color: #BFC7D5;">([</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">chirps</span><span style="color: #D9F5DD;">'</span><span style="color: #82AAFF;"> </span><span style="color: #89DDFF;">=></span><span style="color: #82AAFF;"> </span><span style="color: #BFC7D5;">$</span><span style="color: #BEC5D4;">getChirps</span><span style="color: #BFC7D5;">,</span><span style="color: #82AAFF;"> </span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">editing</span><span style="color: #D9F5DD;">'</span><span style="color: #82AAFF;"> </span><span style="color: #89DDFF;">=></span><span style="color: #82AAFF;"> null</span><span style="color: #BFC7D5;">]);</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #82AAFF;">on</span><span style="color: #BFC7D5;">([</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #82AAFF;"> </span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">chirp-created</span><span style="color: #D9F5DD;">'</span><span style="color: #82AAFF;"> </span><span style="color: #89DDFF;">=></span><span style="color: #82AAFF;"> </span><span style="color: #BFC7D5;">$</span><span style="color: #BEC5D4;">getChirps</span><span style="color: #BFC7D5;">,</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #82AAFF;"> </span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">chirp-updated</span><span style="color: #D9F5DD;">'</span><span style="color: #82AAFF;"> </span><span style="color: #89DDFF;">=></span><span style="color: #82AAFF;"> </span><span style="color: #BFC7D5;">$</span><span style="color: #BEC5D4;">disableEditing</span><span style="color: #BFC7D5;">,</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #82AAFF;"> </span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">chirp-edit-canceled</span><span style="color: #D9F5DD;">'</span><span style="color: #82AAFF;"> </span><span style="color: #89DDFF;">=></span><span style="color: #82AAFF;"> </span><span style="color: #BFC7D5;">$</span><span style="color: #BEC5D4;">disableEditing</span><span style="color: #BFC7D5;">,</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">]);</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BEC5D4;">$edit</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">->editing</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">getChirps</span><span style="color: #BFC7D5;">();</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-end' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">}; </span></div></details><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BEC5D4;">$delete</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">=</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #BFC7D5;"> {</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">authorize</span><span style="color: #BFC7D5;">(</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">delete</span><span style="color: #D9F5DD;">'</span><span style="color: #BFC7D5;">, </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #BFC7D5;">);</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">delete</span><span style="color: #BFC7D5;">();</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">getChirps</span><span style="color: #BFC7D5;">();</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">}; </span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #D3423E;">?></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">mt-6 bg-white shadow-sm rounded-lg divide-y</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @foreach ($chirps as $chirp)</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">p-6 flex space-x-2</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:key</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">{{ $chirp->id }}</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">svg</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">xmlns</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">http://www.w3.org/2000/svg</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">h-6 w-6 text-gray-600 -scale-x-100</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">fill</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">none</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">viewBox</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">0 0 24 24</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">currentColor</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke-width</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">2</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">path</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke-linecap</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">round</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">stroke-linejoin</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">round</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">d</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">/></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">svg</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">flex-1</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">flex justify-between items-center</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">span</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">text-gray-800</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->user->name }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">span</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">ml-2 text-sm text-gray-600</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->created_at->format('j M Y, g:i a') }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @unless ($chirp->created_at->eq($chirp->updated_at))</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">text-sm text-gray-600</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">&middot;</span><span style="color: #BFC7D5;"> {{ __('edited') }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">small</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endunless</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @if ($chirp->user->is(auth()->user()))</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-dropdown</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">name</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">trigger</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">button</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">svg</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">xmlns</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">http://www.w3.org/2000/svg</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">h-4 w-4 text-gray-400</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">viewBox</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">0 0 20 20</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">fill</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">currentColor</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">path</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">d</span><span style="color: #BFC7D5;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">/></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">svg</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">button</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">name</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">content</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:click</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">edit({{ $chirp->id }})</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {{ __('Edit') }}</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;">></span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:click</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">delete({{ $chirp->id }})</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">wire:confirm</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">Are you sure to delete this chirp?</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;"> </span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {{ __('Delete') }}</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-dropdown-link</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;"> </span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-slot</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">x-dropdown</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endif</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">mt-4 text-lg text-gray-900</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->message }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @if ($chirp->is($editing))</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">livewire:chirps.edit</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">:chirp</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">$chirp</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">:key</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">$chirp->id</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;"> /></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @else</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"><</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;"> </span><span style="color: #FFCB6B;">class</span><span style="color: #89DDFF;">=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">mt-4 text-lg text-gray-900</span><span style="color: #D9F5DD;">"</span><span style="color: #89DDFF;">></span><span style="color: #BFC7D5;">{{ $chirp->message }}</span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">p</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endif</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> @endforeach</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #89DDFF;"></</span><span style="color: #FF5572;">div</span><span style="color: #89DDFF;">></span></div></code></pre> </div> </div> </div> <h2><a id="authorization" href="#authorization" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Authorization</h2> <p>As with editing, we only want our Chirp authors to be able to delete their Chirps, so let's update the <code>delete</code> method in our <code>ChirpPolicy</code> class:</p> <div class="code-container"> <div class="code-container-filename">app/Policies/ChirpPolicy.php</div> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight has-add-lines has-remove-lines has-diff-lines has-summaries' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #D3423E;"><?php</span></div><details><summary style='cursor: pointer; display: block'><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-start' style='user-select: none; color: #4c5374'></span> <span class='summary-hide-when-open' style='color:#4c5374'>...</span></div></summary><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">namespace</span><span style="color: #BFC7D5;"> App\Policies;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> App\Models\</span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> App\Models\</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> Illuminate\Auth\Access\</span><span style="color: #FFCB8B;">HandlesAuthorization</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-end' style='user-select: none; color: #4c5374'></span> </div></details><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #C792EA;">class</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">ChirpPolicy</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">{</span></div><details><summary style='cursor: pointer; display: block'><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-start' style='user-select: none; color: #4c5374'></span> <span class='summary-hide-when-open' style='color:#4c5374'>...</span></div></summary><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">use</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB8B;">HandlesAuthorization</span><span style="color: #BFC7D5;">;</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">/**</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> * Determine whether the user can view any models.</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> </span><span style="color: #697098;">*/</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">viewAny</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$user</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">bool</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">//</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">/**</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> * Determine whether the user can view the model.</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> </span><span style="color: #697098;">*/</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">view</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$user</span><span style="color: #BFC7D5;">, </span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">bool</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">//</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">/**</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> * Determine whether the user can create models.</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> </span><span style="color: #697098;">*/</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">create</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$user</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">bool</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">//</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">/**</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> * Determine whether the user can update the model.</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> </span><span style="color: #697098;">*/</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">update</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$user</span><span style="color: #BFC7D5;">, </span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">bool</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">return</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">user</span><span style="color: #BFC7D5;">()</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">is</span><span style="color: #BFC7D5;">(</span><span style="color: #BEC5D4;">$user</span><span style="color: #BFC7D5;">);</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-end' style='user-select: none; color: #4c5374'></span> </div></details><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">/**</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> * Determine whether the user can delete the model.</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> </span><span style="color: #697098;">*/</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">delete</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$user</span><span style="color: #BFC7D5;">, </span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">bool</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line line-remove line-has-background' style='background-color: #ef535033'><span style="color:#f07178; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">-</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">//</span></div><div class='line line-add line-has-background' style='background-color: #99b76d23'><span style="color:#C3E88D; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number">+</span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">return</span><span style="color: #BFC7D5;"> </span><span style="color: #FF5572;">$this</span><span style="color: #89DDFF;">-></span><span style="color: #82AAFF;">update</span><span style="color: #BFC7D5;">(</span><span style="color: #BEC5D4;">$user</span><span style="color: #BFC7D5;">, </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #BFC7D5;">);</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><details><summary style='cursor: pointer; display: block'><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-start' style='user-select: none; color: #4c5374'></span> <span class='summary-hide-when-open' style='color:#4c5374'>...</span></div></summary><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">/**</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> * Determine whether the user can restore the model.</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> </span><span style="color: #697098;">*/</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">restore</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$user</span><span style="color: #BFC7D5;">, </span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">bool</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">//</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span> </div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">/**</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> * Determine whether the user can permanently delete the model.</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #697098;"> </span><span style="color: #697098;">*/</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">public</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">function</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">forceDelete</span><span style="color: #D9F5DD;">(</span><span style="color: #FFCB8B;">User</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$user</span><span style="color: #BFC7D5;">, </span><span style="color: #FFCB8B;">Chirp</span><span style="color: #BFC7D5;"> </span><span style="color: #BEC5D4;">$chirp</span><span style="color: #D9F5DD;">)</span><span style="color: #89DDFF;">:</span><span style="color: #BFC7D5;"> </span><span style="color: #C792EA;">bool</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> {</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> </span><span style="color: #697098;">//</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-middle' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;"> }</span></div><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-end' style='user-select: none; color: #4c5374'></span> </div></details><div class='line'><span style="color:#4c5374; text-align: right; -webkit-user-select: none; user-select: none;" class="line-number"> </span><span class='summary-caret summary-caret-empty' style='user-select: none; color: #4c5374'></span><span style="color: #BFC7D5;">}</span></div></code></pre> </div> <p>Rather than repeating the logic from the <code>update</code> method, we can define the same logic by calling the <code>update</code> method from our <code>delete</code> method. Anyone that is authorized to update a Chirp will now be authorized to delete it as well.</p> <h2><a id="testing-it-out" href="#testing-it-out" class="heading-permalink" aria-hidden="true" title="Permalink">#</a>Testing it out</h2> <p>If you Chirped anything you weren't happy with, try deleting it!</p> <img src="/img/screenshots/chirp-delete-blade.png" alt="Deleting a chirp" class="rounded-lg border dark:border-none shadow-lg" /> <p><a href="/livewire/notifications-and-events">Continue to notifications & events...</a></p><script> function setTab(tab, group, save) { save = typeof save === 'undefined' ? true : save document .querySelectorAll(`.tabbed-code[data-group="${group}"] .tabbed-code-nav-button`) .forEach(el => el.classList.remove('active')) document .querySelectorAll(`.tabbed-code[data-group="${group}"] .code-container`) .forEach(el => el.classList.remove('active')) document .querySelectorAll(`.tabbed-code[data-group="${group}"] [data-tab="${tab}"]`) .forEach(el => el.classList.add('active')) if (save) { saveTab(tab, group) } } function getTabs() { try { return JSON.parse(localStorage.tabs) } catch { return {} } } function saveTab(tab, group) { localStorage.tabs = JSON.stringify({ ...getTabs(), [group]: tab, }) } function restoreTabs() { Object.entries(getTabs()).forEach(([group, tab]) => setTab(tab, group, false)) } restoreTabs() </script> </div> <script> // Set the active navigation state... Array.from(document.querySelectorAll('#header a, #sidebar a')).forEach(link => { if (link.hostname === location.hostname && (link.pathname === location.pathname || (link.pathname === '/introduction' && location.pathname === '/')) ) { link.classList.add('active') if (link.parentNode.tagName === 'LI') { link.parentNode.parentNode.parentNode.classList.add('sub--on') } } }) // Make the navigation headings expandable... Array.from(document.querySelectorAll('.docs_sidebar h2')).forEach(el => { if (el.children.length > 1) { return } el.addEventListener('click', (e) => { const active = el.parentNode.classList.contains('sub--on'); [...document.querySelectorAll('.docs_sidebar ul li')].forEach(el => el.classList.remove('sub--on')); if (! active) { el.parentNode.classList.add('sub--on'); } }) }) // Highlight the active section in the table of contents... function setActiveTableOfContents () { const links = Array.from(document.querySelectorAll('.table-of-contents a')) const lastVisible = links .slice() .reverse() .find(link => { const el = document.querySelector(link.hash) return el.getBoundingClientRect().top <= 56; }) ?? links[0] links.forEach(link => { if (link === lastVisible) { link.classList.add('active') } else { link.classList.remove('active') } }) } setActiveTableOfContents() window.addEventListener('scroll', setActiveTableOfContents, { passive: true }) </script> </div> </section> </section> </div> </section> </div> <footer class="relative mt-12 pt-12 bg-gradient-to-b from-gray-50 to-white dark:from-dark-800 dark:to-dark-700"> <div class="max-w-screen-2xl mx-auto w-full px-8"> <div> <a href="https://laravel.com" class="inline-flex"> <img class="h-14" src="/img/logo.min.svg" alt="Laravel" loading="lazy"> </a> </div> <div class="mt-6 sm:mt-12"> <p class="max-w-sm text-xs text-gray-700 sm:text-sm dark:text-gray-500">Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in most web projects.</p> <ul class="mt-6 flex items-center space-x-3"> <li> <a href="https://twitter.com/laravelphp"> <img id="footer__twitter_dark" class="hidden dark:inline-block w-6 h-6" src="/img/social/twitter.dark.min.svg" alt="Twitter" loading="lazy" width="24" height="20"> <img id="footer__twitter" class="inline-block dark:hidden w-6 h-6" src="/img/social/twitter.min.svg" alt="Twitter" loading="lazy" width="24" height="20"> </a> </li> <li> <a href="https://github.com/laravel"> <img id="footer__github_dark" class="hidden dark:inline-block w-6 h-6" src="/img/social/github.dark.min.svg" alt="GitHub" loading="lazy" width="24" height="24"> <img id="footer__github" class="inline-block dark:hidden w-6 h-6" src="/img/social/github.min.svg" alt="GitHub" loading="lazy" width="24" height="24"> </a> </li> <li> <a href="https://discord.gg/mPZNm7A"> <img id="footer__discord_dark" class="hidden dark:inline-block w-6 h-6" src="/img/social/discord.dark.min.svg" alt="Discord" loading="lazy" width="21" height="24"> <img id="footer__discord" class="inline-block dark:hidden w-6 h-6" src="/img/social/discord.min.svg" alt="Discord" loading="lazy" width="21" height="24"> </a> </li> <li> <a href="https://www.youtube.com/laravelphp"> <img id="footer__youtube_dark" class="hidden dark:inline-block w-6 h-6" src="/img/social/youtube.dark.min.svg" alt="YouTube" loading="lazy" width="169" height="150"> <img id="footer__youtube" class="inline-block dark:hidden w-6 h-6" src="/img/social/youtube.min.svg" alt="YouTube" loading="lazy" width="169" height="150"> </a> </li> </ul> </div> <div class="mt-10 border-t pt-6 pb-16 border-gray-200 dark:border-dark-500"> <p class="text-xs text-gray-700 dark:text-gray-400"> Laravel is a Trademark of Laravel Holdings Inc.<br /> Copyright © Laravel Holdings Inc. </p> <p class="mt-6 text-xs text-gray-700 dark:text-gray-400"> Code highlighting provided by <a href="https://torchlight.dev">Torchlight</a> </p> </div> </div> </footer> </div> </body> </html>