id
stringlengths
6
6
text
stringlengths
20
17.2k
title
stringclasses
1 value
243222
## Configuration Laravel's filesystem configuration file is located at `config/filesystems.php`. Within this file, you may configure all of your filesystem "disks". Each disk represents a particular storage driver and storage location. Example configurations for each supported driver are included in the configuration ...
243223
## Obtaining Disk Instances The `Storage` facade may be used to interact with any of your configured disks. For example, you may use the `put` method on the facade to store an avatar on the default disk. If you call methods on the `Storage` facade without first calling the `disk` method, the method will automatically ...
243225
## Deleting Files The `delete` method accepts a single filename or an array of files to delete: use Illuminate\Support\Facades\Storage; Storage::delete('file.jpg'); Storage::delete(['file.jpg', 'file2.jpg']); If necessary, you may specify the disk that the file should be deleted from: use Illumina...
243229
## Scope <a name="specifying-the-scope"></a> ### Specifying the Scope As discussed, features are typically checked against the currently authenticated user. However, this may not always suit your needs. Therefore, it is possible to specify the scope you would like to check a given feature against via the `Feature` fa...
243232
# HTTP Tests - [Introduction](#introduction) - [Making Requests](#making-requests) - [Customizing Request Headers](#customizing-request-headers) - [Cookies](#cookies) - [Session / Authentication](#session-and-authentication) - [Debugging Responses](#debugging-responses) - [Exception Handling](#exce...
243241
## Running SQL Queries Once you have configured your database connection, you may run queries using the `DB` facade. The `DB` facade provides methods for each type of query: `select`, `update`, `insert`, `delete`, and `statement`. <a name="running-a-select-query"></a> #### Running a Select Query To run a basic SELEC...
243253
# Upgrade Guide ## Upgrading from Breeze 1.x to Breeze 2.x #### Dependency Changes Unlike other starter kits such as Jetstream, the Laravel Breeze dependency can be removed after you run the `breeze:install` Artisan command. Therefore, if you are in the process of upgrading to Laravel 11, we advise you to simply rem...
243256
<?php namespace App\Http\Middleware; use Illuminate\Http\Request; use Inertia\Middleware; class HandleInertiaRequests extends Middleware { /** * The root template that is loaded on the first page visit. * * @var string */ protected $rootView = 'app'; /** * Determine the current ...
243265
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\User; use Illuminate\Auth\Events\Registered; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rules; use ...
243269
<?php use App\Http\Controllers\Auth\AuthenticatedSessionController; use App\Http\Controllers\Auth\ConfirmablePasswordController; use App\Http\Controllers\Auth\EmailVerificationNotificationController; use App\Http\Controllers\Auth\EmailVerificationPromptController; use App\Http\Controllers\Auth\NewPasswordController; u...
243270
<?php use App\Http\Controllers\ProfileController; use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Route; use Inertia\Inertia; Route::get('/', function () { return Inertia::render('Welcome', [ 'canLogin' => Route::has('login'), 'canRegister' => Route::has('register'), ...
243275
<!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Laravel</title> <!-- Fonts --> <link rel="preconnect" href="https://fonts.bunny.net"> ...
243285
<!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="{{ csrf_token() }}"> <title>{{ config('app.name', 'Laravel') }}</title> ...
243294
<?php use Illuminate\Support\Facades\Route; Route::view('/', 'welcome'); Route::view('dashboard', 'dashboard') ->middleware(['auth', 'verified']) ->name('dashboard'); Route::view('profile', 'profile') ->middleware(['auth']) ->name('profile'); require __DIR__.'/auth.php';
243305
import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; import vue from '@vitejs/plugin-vue'; export default defineConfig({ plugins: [ laravel({ input: 'resources/js/app.js', refresh: true, }), vue({ template: { tra...
243314
<script setup> import { computed, onMounted, onUnmounted, ref } from 'vue'; const props = defineProps({ align: { type: String, default: 'right', }, width: { type: String, default: '48', }, contentClasses: { type: String, default: 'py-1 bg-white dark:b...
243318
<script setup> import { computed } from 'vue'; const emit = defineEmits(['update:checked']); const props = defineProps({ checked: { type: [Array, Boolean], required: true, }, value: { default: null, }, }); const proxyChecked = computed({ get() { return props.checke...
243322
<script setup> import { ref } from 'vue'; import ApplicationLogo from '@/Components/ApplicationLogo.vue'; import Dropdown from '@/Components/Dropdown.vue'; import DropdownLink from '@/Components/DropdownLink.vue'; import NavLink from '@/Components/NavLink.vue'; import ResponsiveNavLink from '@/Components/ResponsiveNavL...
243359
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\View\View; class AuthenticatedSessionController extends Controller { /** ...
243360
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\User; use Illuminate\Auth\Events\Registered; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rules; use ...
243367
<x-guest-layout> <form method="POST" action="{{ route('password.store') }}"> @csrf <!-- Password Reset Token --> <input type="hidden" name="token" value="{{ $request->route('token') }}"> <!-- Email Address --> <div> <x-input-label for="email" :value="__('Email')...
243368
<x-guest-layout> <form method="POST" action="{{ route('register') }}"> @csrf <!-- Name --> <div> <x-input-label for="name" :value="__('Name')" /> <x-text-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocom...
243372
<x-guest-layout> <!-- Session Status --> <x-auth-session-status class="mb-4" :status="session('status')" /> <form method="POST" action="{{ route('login') }}"> @csrf <!-- Email Address --> <div> <x-input-label for="email" :value="__('Email')" /> <x-text-input...
243373
<a {{ $attributes->merge(['class' => 'block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-800 transition duration-150 ease-in-out']) }}>{{ $slot }}</a>
243381
@props(['align' => 'right', 'width' => '48', 'contentClasses' => 'py-1 bg-white dark:bg-gray-700']) @php $alignmentClasses = match ($align) { 'left' => 'ltr:origin-top-left rtl:origin-top-right start-0', 'top' => 'origin-top', default => 'ltr:origin-top-right rtl:origin-top-left end-0', }; $width = match ...
243390
<nav x-data="{ open: false }" class="bg-white dark:bg-gray-800 border-b border-gray-100 dark:border-gray-700"> <!-- Primary Navigation Menu --> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div class="flex justify-between h-16"> <div class="flex"> <!-- Logo --> ...
243400
<?php use App\Http\Controllers\Auth\AuthenticatedSessionController; use App\Http\Controllers\Auth\ConfirmablePasswordController; use App\Http\Controllers\Auth\EmailVerificationNotificationController; use App\Http\Controllers\Auth\EmailVerificationPromptController; use App\Http\Controllers\Auth\NewPasswordController; u...
243401
<?php use App\Http\Controllers\ProfileController; use Illuminate\Support\Facades\Route; Route::get('/', function () { return view('welcome'); }); Route::get('/dashboard', function () { return view('dashboard'); })->middleware(['auth', 'verified'])->name('dashboard'); Route::middleware('auth')->group(functio...
243412
<?php use App\Livewire\Actions\Logout; use Livewire\Volt\Component; new class extends Component { /** * Log the current user out of the application. */ public function logout(Logout $logout): void { $logout(); $this->redirect('/', navigate: true); } }; ?> <nav x-data="{ ope...
243418
<?php use App\Models\User; use Illuminate\Auth\Events\Registered; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rules; use Livewire\Attributes\Layout; use Livewire\Volt\Component; new #[Layout('layouts.guest')] class extends Component { public string $name = '...
243422
<?php use App\Livewire\Forms\LoginForm; use Illuminate\Support\Facades\Session; use Livewire\Attributes\Layout; use Livewire\Volt\Component; new #[Layout('layouts.guest')] class extends Component { public LoginForm $form; /** * Handle an incoming authentication request. */ public function login...
243433
import { Transition } from '@headlessui/react'; import { InertiaLinkProps, Link } from '@inertiajs/react'; import { createContext, Dispatch, PropsWithChildren, SetStateAction, useContext, useState, } from 'react'; const DropDownContext = createContext<{ open: boolean; setOpen: Dispatch<...
243441
import ApplicationLogo from '@/Components/ApplicationLogo'; import Dropdown from '@/Components/Dropdown'; import NavLink from '@/Components/NavLink'; import ResponsiveNavLink from '@/Components/ResponsiveNavLink'; import { Link, usePage } from '@inertiajs/react'; import { PropsWithChildren, ReactNode, useState } from '...
243470
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Auth; class AuthenticatedSessionController extends Controller { /** * Handle an incoming authenti...
243471
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\User; use Illuminate\Auth\Events\Registered; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rules; class Regis...
243472
<?php use Laravel\Sanctum\Sanctum; return [ /* |-------------------------------------------------------------------------- | Stateful Domains |-------------------------------------------------------------------------- | | Requests from the following domains / hosts will receive stateful API ...
243473
<?php return [ /* |-------------------------------------------------------------------------- | Cross-Origin Resource Sharing (CORS) Configuration |-------------------------------------------------------------------------- | | Here you may configure your settings for cross-origin resource shar...
243478
<?php use App\Http\Controllers\Auth\AuthenticatedSessionController; use App\Http\Controllers\Auth\EmailVerificationNotificationController; use App\Http\Controllers\Auth\NewPasswordController; use App\Http\Controllers\Auth\PasswordResetLinkController; use App\Http\Controllers\Auth\RegisteredUserController; use App\Http...
243479
<?php use Illuminate\Support\Facades\Route; Route::get('/', function () { return ['Laravel' => app()->version()]; }); require __DIR__.'/auth.php';
243480
<?php use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; Route::middleware(['auth:sanctum'])->get('/user', function (Request $request) { return $request->user(); });
243488
import '../css/app.css'; import './bootstrap'; import { createInertiaApp } from '@inertiajs/vue3'; import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; import { createApp, DefineComponent, h } from 'vue'; import { ZiggyVue } from '../../vendor/tightenco/ziggy'; const appName = import.meta.env.V...
243499
<script setup lang="ts"> import { computed, onMounted, onUnmounted, ref } from 'vue'; const props = withDefaults( defineProps<{ align?: 'left' | 'right'; width?: '48'; contentClasses?: string; }>(), { align: 'right', width: '48', contentClasses: 'py-1 bg-whit...
243507
<script setup lang="ts"> import { ref } from 'vue'; import ApplicationLogo from '@/Components/ApplicationLogo.vue'; import Dropdown from '@/Components/Dropdown.vue'; import DropdownLink from '@/Components/DropdownLink.vue'; import NavLink from '@/Components/NavLink.vue'; import ResponsiveNavLink from '@/Components/Resp...
243529
<?php use App\Livewire\Actions\Logout; $logout = function (Logout $logout) { $logout(); $this->redirect('/', navigate: true); }; ?> <nav x-data="{ open: false }" class="bg-white dark:bg-gray-800 border-b border-gray-100 dark:border-gray-700"> <!-- Primary Navigation Menu --> <div class="max-w-7xl m...
243535
<?php use App\Models\User; use Illuminate\Auth\Events\Registered; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rules; use function Livewire\Volt\layout; use function Livewire\Volt\rules; use function Livewire\Volt\state; layout('layouts.guest'); state([ 'na...
243539
<?php use App\Livewire\Forms\LoginForm; use Illuminate\Support\Facades\Session; use function Livewire\Volt\form; use function Livewire\Volt\layout; layout('layouts.guest'); form(LoginForm::class); $login = function () { $this->validate(); $this->form->authenticate(); Session::regenerate(); $this...
243553
#[AsCommand(name: 'breeze:install')] class InstallCommand extends Command implements PromptsForMissingInput { use InstallsApiStack, InstallsBladeStack, InstallsInertiaStacks, InstallsLivewireStack; /** * The name and signature of the console command. * * @var string */ protected $signat...
243564
<?php namespace LegacyTests; use Illuminate\Foundation\Http\Kernel; class HttpKernel extends Kernel { /** * The application's global HTTP middleware stack. * * These middleware are run during every request to your application. * * @var array */ protected $middleware = [ ...
243568
<?php namespace LegacyTests\Unit; use Orchestra\Testbench\TestCase as BaseTestCase; use Livewire\LivewireServiceProvider; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Artisan; class TestCase extends BaseTestCase { public function setUp(): void { $this->afterApplicationCreated(f...
243570
<div> @if (session('status')) <div class="alert-success mb-" role="alert"> {{ session('status') }} </div> @endif </div>
243571
<div> @foreach ($models as $model) {{ $model->title }} @endforeach </div>
243610
class TestCase extends BaseTestCase { use SupportsSafari; public static $useSafari = false; public static $useAlpineV3 = false; function visitLivewireComponent($browser, $classes, $queryString = '') { $classes = (array) $classes; $this->registerComponentForNextTest($classes); ...
243669
<div> <input dusk="foo.bar" type="radio" wire:model="foo" value="bar" name="foo"> <input dusk="foo.baz" type="radio" wire:model="foo" value="baz" name="foo"> </div>
243690
<div> <button wire:click="$refresh" dusk="refresh">Refresh</button> <button wire:click="flashMessage" dusk="flash">Flash</button> <button wire:click="redirectWithFlash" dusk="redirect-with-flash">Redirect With Flash</button> <button wire:click="redirectPage" dusk="redirect.button">Redirect Page</button...
243711
<div> <span dusk="baz-output">{{ $baz }}</span> <input wire:model.live="baz" type="text" dusk="baz-input"> </div>
243719
<div> <input wire:model.live="search" type="text" dusk="search"> @foreach ($posts as $post) <h1 wire:key="post-{{ $post->id }}">{{ $post->title }}</h1> @endforeach {{ $posts->links() }} </div>
243721
<div> {{-- <div x-data="{ count: $queryString(1) }"> <input type="text" x-model="count"> <span x-text="count"></span> </div> <br> <br> <br> --}} <span dusk="output">{{ $foo }}</span> <span dusk="bar-output">{{ $bar }}</span> <span dusk="qux.hyphen">{{ $qux['hyphen'] }}...
243753
<div> <input wire:model.live="foo" dusk="foo.input"> <button wire:click="changeFoo" dusk="foo.button">Change Foo</button> <input wire:model.live="bar.baz" dusk="bar.input"> <button wire:click="resetBar" dusk="bar.button">Change BarBaz</button> </div>
243757
<div> <input type="text" wire:model.live="foo" dusk="foo"><span dusk="foo.output">{{ $foo }}</span> <button wire:click="updateFooTo('changed')" dusk="foo.change">Change Foo</button> <input type="text" wire:model.live="bar.baz.bob" dusk="bar"><span dusk="bar.output">@json($bar)</span> <input type="text...
243760
<div> <textarea wire:model.live="foo" dusk="foo" class="{{ $showFooClass ? 'foo' : '' }}"></textarea><span dusk="foo.output">{{ $foo }}</span> <button wire:click="updateFooTo('changed')" dusk="foo.change">Change Foo</button> <button wire:click="$set('showFooClass', true)" dusk="foo.add-class">Add Class</but...
243765
<?php namespace LegacyTests\Browser\DataBinding\Lazy; use Livewire\Component as BaseComponent; class LazyInputsWithUpdatesDisplayedComponent extends BaseComponent { public $name; public $description; public $is_active = false; public $updates = []; public function updated() { $this...
243785
<html> <head> @livewireStyles <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> {{ $slot }} @livewireScripts <script type="module"> import hotwiredTurbo from 'https://cdn.skypack.dev/@hotwired/turbo'; </script> <script src="https://cdn.jsdelivr.net/gh/livewire/t...
243786
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> {{ $slot }} @stack('scripts') </body> </html>
243787
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> @yield('content') @stack('scripts') </body> </html>
243788
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> {{ $slot }} @stack('scripts') </body> </html>
243794
var UploadManager = class { constructor(component) { this.component = component; this.uploadBag = new MessageBag(); this.removeBag = new MessageBag(); } registerListeners() { this.component.$wire.$on("upload:generatedSignedUrl", ({ name, url }) => { setUploadLoading(this.comp...
243828
function track2(name, initialSeedValue, alwaysShow = false, except = null) { let { has: has2, get: get3, set: set3, remove } = queryStringUtils(); let url = new URL(window.location.href); let isInitiallyPresentInUrl = has2(url, name); let initialValue = isInitiallyPresentInUrl ? get3(url, name) : initia...
243838
function ye(e){let t=ci(e)?e[0]:e,r=ci(e)?e[1]:void 0;return St(t)&&Object.entries(t).forEach(([n,i])=>{t[n]=ye(i)}),t}function ci(e){return Array.isArray(e)&&e.length===2&&typeof e[1]=="object"&&Object.keys(e[1]).includes("s")}function Et(){if(document.querySelector('meta[name="csrf-token"]'))return document.querySele...
243846
zo.inline=(e,{value:t,modifiers:r,expression:n})=>{!t||(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:n,extract:!1})};$("bind",zo);function wc(e,t){e._x_keyExpression=t}ao(()=>`[${He("data")}]`);$("data",(e,{expression:t},{cleanup:r})=>{if(yc(e))return;t=t===""?"{}":t;let n={};Pr(n,e)...
243857
function ya(e){return(Aa(e)?e.src:e.href).split("?")}function xa(e){return e.tagName.toLowerCase()==="link"&&e.getAttribute("rel").toLowerCase()==="stylesheet"||e.tagName.toLowerCase()==="style"||e.tagName.toLowerCase()==="script"}function Aa(e){return e.tagName.toLowerCase()==="script"}function Ca(e){return e.split(""...
243902
var UploadManager = class { constructor(component) { this.component = component; this.uploadBag = new MessageBag(); this.removeBag = new MessageBag(); } registerListeners() { this.component.$wire.$on("upload:generatedSignedUrl", ({ name, url }) => { setUploadLoading(this.component, name); ...
243910
function track(name, initialSeedValue, alwaysShow = false, except = null) { let { has, get, set, remove } = queryStringUtils(); let url = new URL(window.location.href); let isInitiallyPresentInUrl = has(url, name); let initialValue = isInitiallyPresentInUrl ? get(url, name) : initialSeedValue; let initialValu...
243917
<?php return [ /* |--------------------------------------------------------------------------- | Class Namespace |--------------------------------------------------------------------------- | | This value sets the root class namespace for Livewire component classes in | your application. T...
243956
import { isObjecty } from "@/utils" export default function history(Alpine) { Alpine.magic('queryString', (el, { interceptor }) => { let alias let alwaysShow = false let usePush = false return interceptor((initialSeedValue, getter, setter, path, key) => { let queryKey ...
243957
function fromQueryString(search) { search = search.replace('?', '') if (search === '') return {} let insertDotNotatedValueIntoData = (key, value, data) => { let [first, second, ...rest] = key.split('.') // We're at a leaf node, let's make the assigment... if (! second) return data...
243958
export function hasQueryParam(param) { let queryParams = new URLSearchParams(window.location.search); return queryParams.has(param) } export function getQueryParam(param) { let queryParams = new URLSearchParams(window.location.search); return queryParams.get(param) } export function setQueryParam(pa...
243988
<?php namespace Tests; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Artisan; class TestCase extends \Orchestra\Testbench\Dusk\TestCase { public function setUp(): void { $this->afterApplicationCreated(function () { $this->makeACleanSlate(); }); $this...
244000
<div> @foreach ($children as $child) @livewire('child', ['name' => $child], key($child)) @endforeach </div>
244013
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> <h1>This is a custom layout</h1> {{ $slot }} @stack('scripts') </body> </html>
244014
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> {{ $slot }} @stack('scripts') </body> </html>
244015
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> {{ $header ?? 'No Header' }} {{ $slot }} {{ $footer ?? 'No Footer' }} </body> </html>
244016
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> <style> .show { display: block; } </style> </head> <body> {{ $slot }} @stack('scripts') </body> </html>
244028
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> </head> <body> {{ $slot }} @stack('scripts') </body> </html>
244030
<html> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> @stack('styles') </head> <body> {{ $slot }} @stack('scripts') </body> </html>
244037
Because forms are the backbone of most web applications, Livewire provides loads of helpful utilities for building them. From handling simple input elements to complex things like real-time validation or file uploading, Livewire has simple, well-documented tools to make your life easier and delight your users. Let's d...
244038
### Resetting form fields If you are using a form object, you may want to reset the form after it has been submitted. This can be done by calling the `reset()` method: ```php <?php namespace App\Livewire\Forms; use Livewire\Attributes\Validate; use App\Models\Post; use Livewire\Form; class PostForm extends Form { ...
244040
xtracting input fields to Blade components Even in a small component such as the `CreatePost` example we've been discussing, we end up duplicating lots of form field boilerplate like validation messages and labels. It can be helpful to extract repetitive UI elements such as these into dedicated [Blade components](htt...
244047
Here at Livewire HQ, we try to remove problems from your pathway before you hit them. However, sometimes, there are some problems that we can't solve without introducing new ones, and other times, there are problems we can't anticipate. Here are some common errors and scenarios you may encounter in your Livewire apps....
244049
## Controlling Livewire from Alpine using `$wire` One of the most powerful features available to you as a Livewire developer is `$wire`. The `$wire` object is a magic object available to all your Alpine components that are used inside of Livewire. You can think of `$wire` as a gateway from JavaScript into PHP. It all...
244051
Livewire makes it easy to bind a component property's value with form inputs using `wire:model`. Here is a simple example of using `wire:model` to bind the `$title` and `$content` properties with form inputs in a "Create Post" component: ```php use Livewire\Component; use App\Models\Post; class CreatePost extends Co...
244052
nput fields Livewire supports most native input elements out of the box. Meaning you should just be able to attach `wire:model` to any input element in the browser and easily bind properties to them. Here's a comprehensive list of the different available input types and how you use them in a Livewire context. ### Te...
244057
Livewire's `wire:navigate` feature makes page navigation much faster, providing an SPA-like experience for your users. This page is a simple reference for the `wire:navigate` directive. Be sure to read the [page on Livewire's Navigate feature](/docs/navigate) for more complete documentation. Below is a simple example...
244059
## Real-time validation Real-time validation is the term used for when you validate a user's input as they fill out a form rather than waiting for the form submission. By using `#[Validate]` attributes directly on Livewire properties, any time a network request is sent to update a property's value on the server, the ...
244061
After a user performs some action — like submitting a form — you may want to redirect them to another page in your application. Because Livewire requests aren't standard full-page browser requests, standard HTTP redirects won't work. Instead, you need to trigger redirects via JavaScript. Fortunately, Livewire exposes ...
244065
## Basic usage Showing or hiding content in Livewire is as simple as using one of Blade's conditional directives like `@if`. To enhance this experience for your users, Livewire provides a `wire:transition` directive that allows you to transition conditional elements smoothly in and out of the page. For example, below...
244066
Customizing transitions To customize the CSS Livewire internally uses when transitioning, you can use any combination of the available modifiers: Modifier | Description --- | --- `.in` | Only transition the element "in" `.out` | Only transition the element "out" `.duration.[?]ms` | Customize the transition duration i...
244067
To begin your Livewire journey, we will create a simple "counter" component and render it in the browser. This example is a great way to experience Livewire for the first time as it demonstrates Livewire's _liveness_ in the simplest way possible. ## Prerequisites Before we start, make sure you have the following inst...
244068
Components are the building blocks of your Livewire application. They combine state and behavior to create reusable pieces of UI for your front end. Here, we'll cover the basics of creating and rendering components. ## Creating components A Livewire component is simply a PHP class that extends `Livewire\Component`. Y...
244070
omponents Livewire allows you to assign components directly to a route in your Laravel application. These are called "full-page components". You can use them to build standalone pages with logic and views, fully encapsulated within a Livewire component. To create a full-page component, define a route in your `routes/...
244071
e model binding Laravel's route model binding allows you to automatically resolve Eloquent models from route parameters. After defining a route with a model parameter in your `routes/web.php` file: ```php use App\Livewire\ShowPost; Route::get('/posts/{post}', ShowPost::class); ``` You can now accept the route mode...