Merge pull request #277 from php-flasher/dev

update livewire and inertiajs documentation
This commit is contained in:
Younes ENNAJI
2025-03-26 21:34:02 +00:00
committed by GitHub
9 changed files with 1720 additions and 1936 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{
"dist/main.css": "/dist/main.f1c926c2.css",
"dist/main.css": "/dist/main.0e65cac0.css",
"dist/main.js": "/dist/main.8b056786.js",
"dist/455.3a7b4474.css": "/dist/455.3a7b4474.css",
"dist/455.095e6545.js": "/dist/455.095e6545.js",
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2,7 +2,7 @@
"entrypoints": {
"main": {
"css": [
"/dist/main.f1c926c2.css"
"/dist/main.0e65cac0.css"
],
"js": [
"/dist/main.8b056786.js"
File diff suppressed because one or more lines are too long
+1703 -1
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -739,7 +739,7 @@ class FlashController extends Controller
public function getFlashMessages()
{
// Get all flash messages as an array
$messages = flash()->render([], 'array');
$messages = flash()->render('array');
return response()->json($messages);
}
@@ -1,5 +1,8 @@
---
layout: default
permalink: /livewire/
title: Livewire
description: Learn how to add flash notifications to your Livewire application using PHPFlasher. This guide walks you through installation and usage, so you can engage your users with informative messages.
adapter: flasher
---
<div class="max-w-7xl mx-auto">
@@ -471,9 +474,9 @@ class UserComponent extends Component
public function render()
{
return <<<'HTML'
<div>
<button wire:click="deleteUser">Delete User</button>
</div>
&lt;div&gt;
&lt;button wire:click="deleteUser"&gt;Delete User&lt;/button&gt;
&lt;/div&gt;
HTML;
}
@@ -736,12 +739,11 @@ class PublishArticle extends Component
{
sweetalert()
->option('title', 'Publish article?')
->option('text', 'This will make the article visible to all users')
->option('icon', 'question')
->option('showCancelButton', true)
->option('confirmButtonText', 'Yes, publish it!')
->option('cancelButtonText', 'Not yet')
->fire();
->question('Are you sure you want to publish this article?');
}
#[On('sweetalert:confirmed')]
@@ -757,12 +759,11 @@ class PublishArticle extends Component
// Second notification (after a delay)
sweetalert()
->timer(3000)
->option('title', 'Would you like to share it?')
->option('showCancelButton', true)
->option('confirmButtonText', 'Yes, share it!')
->option('cancelButtonText', 'No thanks')
->option('actionType', 'share') // Custom option to identify action
->fire();
->question('Do you want to share this article?');
}
#[On('sweetalert:confirmed')]
@@ -800,8 +801,8 @@ class PublishArticle extends Component
</p>
<!-- Alpine.js integration -->
<div class="grid md:grid-cols-2 gap-6 mb-6">
<div class="bg-white rounded-lg p-5 border border-slate-200 shadow-sm">
<div class="mb-6">
<div class="bg-white rounded-lg p-5 border border-slate-200 shadow-sm mb-4">
<div class="flex items-center mb-3">
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center mr-3">
<svg class="w-5 h-5 text-blue-600" fill="currentColor" viewBox="0 0 24 24">
-7
View File
@@ -1,7 +0,0 @@
---
permalink: /livewire/
title: Livewire
description: Learn how to add flash notifications to your Livewire application using PHPFlasher. This guide walks you through installation and usage, so you can engage your users with informative messages.
adapter: flasher
layout: livewire
---
+1 -1
View File
@@ -737,7 +737,7 @@ document.getElementById('saveForm').addEventListener('submit', function(e) {
public function getFlashMessages(): JsonResponse
{
// Get all flash messages as an array
$messages = flash()->render([], 'array');
$messages = flash()->render('array');
return $this->json($messages);
}</code></pre>