Skip to content

Commit

Permalink
Merge pull request #17 from lara-zeus/event
Browse files Browse the repository at this point in the history
add event
  • Loading branch information
atmonshi authored Sep 7, 2022
2 parents ab832e0 + 371e2f3 commit d521f49
Show file tree
Hide file tree
Showing 8 changed files with 13,426 additions and 97 deletions.
245 changes: 162 additions & 83 deletions composer.lock

Large diffs are not rendered by default.

688 changes: 687 additions & 1 deletion resources/dist/admin.js

Large diffs are not rendered by default.

8,096 changes: 8,094 additions & 2 deletions resources/dist/app.css

Large diffs are not rendered by default.

4,453 changes: 4,451 additions & 2 deletions resources/dist/app.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions resources/views/forms/fill-forms.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<p class="text-gray-400 text-mdd my-4">{{ $zeusForm->desc ?? '' }}</p>
</x-slot>

{{ \Filament\Facades\Filament::renderHook('zeus-form.before') }}

<form wire:submit.prevent="store">
<div class="my-10">
{!! nl2br($zeusForm->details) !!}
Expand Down
9 changes: 0 additions & 9 deletions src/BoltServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ public function boot()
], 'zeus-bolt-factories');
}

seo()
->site(config('app.name', 'Laravel'))
->title(config('zeus-bolt.site_title'))
->description(config('zeus-bolt.site_description'))
->rawTag('favicon', '<link rel="icon" type="image/x-icon" href="'.asset('favicon/favicon.ico').'">')
->rawTag('<meta name="theme-color" content="'.config('zeus-bolt.site_color').'" />')
->withUrl()
->twitter();

return parent::boot();
}

Expand Down
27 changes: 27 additions & 0 deletions src/Events/FormMounted.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace LaraZeus\Bolt\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use LaraZeus\Bolt\Models\Form;

class FormMounted
{
use Dispatchable, InteractsWithSockets, SerializesModels;

/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new PrivateChannel('form-mounted');
}
}
3 changes: 3 additions & 0 deletions src/Http/Livewire/FillForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Filament\Forms;
use Filament\Forms\Components\Wizard;
use LaraZeus\Bolt\Events\FormMounted;
use LaraZeus\Bolt\Models\Collection;
use LaraZeus\Bolt\Models\FieldResponse;
use LaraZeus\Bolt\Models\Form;
Expand Down Expand Up @@ -84,6 +85,8 @@ public function mount($slug)
$this->zeusData[$field->id] = '';
}

event(new FormMounted($this->zeusForm));

//$rules = $validationAttributes = [];
}

Expand Down

0 comments on commit d521f49

Please sign in to comment.