@@ -272,19 +272,19 @@ <h3 class="text-lg font-semibold mb-3">#[Reactive]</h3>
272272 Applied to the class. Enables ForgeWire to monitor this controller. Controllers without this
273273 attribute are ignored by the reactive engine for security.
274274 </ p >
275+ </ section >
275276
277+ < section id ="state-management " class ="section-anchor mb-12 ">
278+ < h2 class ="text-2xl font-bold text-gray-900 mb-4 "> State Management</ h2 >
276279 < h3 class ="text-lg font-semibold mb-3 "> #[State]</ h3 >
277280 < p class ="text-gray-600 mb-4 ">
278281 Applied to public properties. Tells ForgeWire to persist this value between requests in the
279282 session. Supports scalars (int, string, bool) and arrays.
280283 </ p >
284+ </ section >
281285
282- < h3 class ="text-lg font-semibold mb-3 "> #[Action]</ h3 >
283- < p class ="text-gray-600 mb-4 ">
284- Applied to methods. Marks the method as "safe" to be called from the browser. ForgeWire will
285- refuse to call any method not explicitly marked as an action.
286- </ p >
287-
286+ < section id ="complex-data " class ="section-anchor mb-12 ">
287+ < h2 class ="text-2xl font-bold text-gray-900 mb-4 "> Complex Data Types</ h2 >
288288 < h3 class ="text-lg font-semibold mb-3 "> #[Model] & #[DTO]</ h3 >
289289 < p class ="text-gray-600 mb-4 ">
290290 Use these for complex data types. ForgeWire will handle the serialization/unserialization
@@ -300,7 +300,7 @@ <h3 class="text-lg font-semibold mb-3">#[Model] & #[DTO]</h3>
300300 </ section >
301301
302302 <!-- Frontend Directives -->
303- < section id ="frontend " class ="section-anchor mb-12 ">
303+ < section id ="directives " class ="section-anchor mb-12 ">
304304 < h2 class ="text-2xl font-bold text-gray-900 mb-4 "> Frontend Directives</ h2 >
305305 < p class ="text-gray-600 mb-6 ">
306306 ForgeWire uses HTML attributes (directives) to bind your UI to your controller.
@@ -354,31 +354,40 @@ <h2 class="text-2xl font-bold text-gray-900 mb-4">Security: The Sandbox</h2>
354354 path to prevent "component injection" or cross-page state reuse.</ li >
355355 </ ul >
356356 </ section >
357- The < code class ="bg-gray-100 px-2 py-1 rounded "> input()</ code > action is built-in and handles
358- wire:model updates:
359- </ p >
360- < div class ="code-block p-6 text-white rounded-lg mb-6 ">
361- < pre > < code class ="language-php "> // Automatically called for wire:model
357+ < section id ="actions " class ="section-anchor mb-12 ">
358+ < h2 class ="text-2xl font-bold text-gray-900 mb-4 "> Actions & Methods</ h2 >
359+ < h3 class ="text-lg font-semibold mb-3 "> The #[Action] Attribute</ h3 >
360+ < p class ="text-gray-600 mb-4 ">
361+ Applied to methods. Marks the method as "safe" to be called from the browser. ForgeWire will
362+ refuse to call any method not explicitly marked as an action.
363+ </ p >
364+ < p class ="text-gray-600 mb-4 ">
365+ The < code class ="bg-gray-100 px-2 py-1 rounded "> input()</ code > action is built-in and
366+ handles
367+ < code > fw:model</ code > updates:
368+ </ p >
369+ < div class ="code-block p-6 text-white rounded-lg mb-6 ">
370+ < pre > < code class ="language-php "> // Automatically called for fw:model
362371#[Action]
363372public function input(...$keys): void
364373{
365- // Called when wire :model values change
374+ // Called when fw :model values change
366375 // $keys contains which properties changed
367376}</ code > </ pre >
368- </ div >
377+ </ div >
369378
370- < h3 class ="text-lg font-semibold mb-3 "> Calling Actions from Frontend</ h3 >
371- < div class ="code-block p-6 text-white rounded-lg mb-6 ">
372- < pre > < code class ="language-html "> < !-- wire :click -->
373- < button wire :click ="increment "> + < /button >
374- < button wire :click ="update(5, 'New Name') "> Update< /button >
375-
376- < !-- wire :submit -->
377- < form wire :submit ="save ">
378- < input wire :model ="name " type ="text ">
379- < button type ="submit "> Save< /button >
380- < /form > </ code > </ pre >
381- </ div >
379+ < h3 class ="text-lg font-semibold mb-3 "> Calling Actions from Frontend</ h3 >
380+ < div class ="code-block p-6 text-white rounded-lg mb-6 ">
381+ < pre > < code class ="language-html "> < !-- fw :click -->
382+ < button fw :click="increment">+< /button>
383+ < button fw :click="update(5, 'New Name')"> Update< /button>
384+
385+ < !-- fw :submit -->
386+ < form fw :submit="save">
387+ < input fw :model="name" type="text">
388+ < button type="submit"> Save< /button>
389+ < /form> </ code > </ pre >
390+ </ div >
382391 </ section >
383392
384393 <!-- Computed Properties -->
@@ -431,52 +440,51 @@ <h2 class="text-2xl font-bold text-gray-900 mb-4">Validation</h2>
431440 </ p >
432441 </ section >
433442
434- <!-- Frontend Integration -->
435443 < section id ="frontend " class ="section-anchor mb-12 ">
436444 < h2 class ="text-2xl font-bold text-gray-900 mb-4 "> Frontend Integration</ h2 >
437445 < p class ="text-gray-600 mb-6 ">
438446 ForgeWire's JavaScript client handles all frontend interactions automatically.
439447 </ p >
440448
441- < h3 class ="text-lg font-semibold mb-3 "> Wire Directives</ h3 >
449+ < h3 class ="text-lg font-semibold mb-3 "> Directives Reference </ h3 >
442450 < ul class ="list-disc list-inside space-y-2 text-gray-600 mb-4 ">
443- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :click="method"</ code > — Call action on
451+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :click="method"</ code > — Call action on
444452 click</ li >
445- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :model="property"</ code > — Two-way
453+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :model="property"</ code > — Two-way
446454 binding (immediate)</ li >
447- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :model.lazy</ code > — Update on
455+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :model.lazy</ code > — Update on
448456 blur/change</ li >
449- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :model.debounce</ code > — Debounced
457+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :model.debounce</ code > — Debounced
450458 updates (600ms default)</ li >
451- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :model.debounce.300ms</ code > — Custom
459+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :model.debounce.300ms</ code > — Custom
452460 debounce time</ li >
453- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :submit="method"</ code > — Form
461+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :submit="method"</ code > — Form
454462 submission</ li >
455- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :poll</ code > — Auto-refresh every 2
463+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :poll</ code > — Auto-refresh every 2
456464 seconds</ li >
457- < li > < code class ="bg-gray-100 px-2 py-1 rounded "> wire :poll.5s</ code > — Custom poll interval
465+ < li > < code class ="bg-gray-100 px-2 py-1 rounded "> fw :poll.5s</ code > — Custom poll interval
458466 </ li >
459467 </ ul >
460468
461469 < h3 class ="text-lg font-semibold mb-3 "> Example HTML</ h3 >
462470 < div class ="code-block p-6 text-white rounded-lg mb-6 ">
463- < pre > < code class ="language-html "> < div wire :id ="fw-0b4c5e3d9e83 " wire:component ="App\Components\Wire\Counter " >
464- < div class ="counter ">
465- < button wire :click ="decrement "> – < /button >
466- < span > 2 (even)< /span >
467- < button wire :click ="increment "> + < /button >
468- < /div >
469- < /div > </ code > </ pre >
471+ < pre > < code class ="language-html "> < div fw :id="fw-0b4c5e3d9e83" fw:controller ="App\Controllers\CounterController">
472+ < div class="counter">
473+ < button fw :click="decrement">–< /button>
474+ < span> 2 (even)< /span>
475+ < button fw :click="increment">+< /button>
476+ < /div>
477+ < /div> </ code > </ pre >
470478 </ div >
471479
472480 < h3 class ="text-lg font-semibold mb-3 "> Polling with IntersectionObserver</ h3 >
473481 < p class ="text-gray-600 mb-4 ">
474482 Components only poll when visible on screen (performance optimization):
475483 </ p >
476484 < div class ="code-block p-6 text-white rounded-lg mb-6 ">
477- < pre > < code class ="language-html "> < div wire :id ="... " wire:component ="... " wire :poll.5s>
478- < !-- Only polls when visible -->
479- < /div > </ code > </ pre >
485+ < pre > < code class ="language-html "> < div fw :id="..." fw:controller ="..." fw :poll.5s>
486+ < !-- Only polls when visible -->
487+ < /div> </ code > </ pre >
480488 </ div >
481489 </ section >
482490
@@ -491,7 +499,7 @@ <h3 class="text-lg font-semibold mb-3">Request Format</h3>
491499 < div class ="code-block p-6 text-white rounded-lg mb-6 ">
492500 < pre > < code class ="language-json "> {
493501 "id": "fw-0b4c5e3d9e83",
494- "component ": "App\\Components\\Wire\\Counter",
502+ "controller ": "App\\Components\\Wire\\Counter",
495503 "action": "increment",
496504 "args": [],
497505 "dirty": {},
@@ -505,7 +513,7 @@ <h3 class="text-lg font-semibold mb-3">Request Format</h3>
505513 < h3 class ="text-lg font-semibold mb-3 "> Response Format</ h3 >
506514 < div class ="code-block p-6 text-white rounded-lg mb-6 ">
507515 < pre > < code class ="language-json "> {
508- "html": "< div wire :id =\ "fw-0b4c5e3d9e83\"...> ...< /div > ",
516+ "html": "< div fw :id=\"fw-0b4c5e3d9e83\"...> ...< /div> ",
509517 "state": {},
510518 "checksum": "632b5d500042bb4361657ea9f2991132d8a18208d0e38bf6a801f127f48f4e8c",
511519 "events": [],
@@ -737,8 +745,8 @@ <h3 class="font-semibold text-lg mb-3 text-green-600">Things That Often Help</h3
737745 < li > • Use #[Service] for dependency injection</ li >
738746 < li > • Keep components focused and single-purpose</ li >
739747 < li > • Use computed properties for derived values</ li >
740- < li > • Leverage wire :model.debounce for search inputs</ li >
741- < li > • Use wire :poll sparingly (only when needed)</ li >
748+ < li > • Leverage fw :model.debounce for search inputs</ li >
749+ < li > • Use fw :poll sparingly (only when needed)</ li >
742750 </ ul >
743751 </ div >
744752
0 commit comments