PHP code example of hostmoz / blade-bootstrap-components
1. Go to this page and download the library: Download hostmoz/blade-bootstrap-components library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hostmoz / blade-bootstrap-components example snippets
namespace App\Livewire;
use Hostmoz\BladeBootstrapComponents\Components\Elements\ModalComponent;
class EditUserModal extends ModalComponent
{
public User $user;
public string $name = '';
public string $email = '';
// Optional: Set a title for the modal header
public function mount(User $user)
{
$this->user = $user;
$this->name = $user->name;
$this->email = $user->email;
}
public function render()
{
// Add modal-title attribute for the header title
return view('livewire.edit-user-modal', [
'modalTitle' => 'Edit User: ' . $this->user->name
]);
}
public function save()
{
$this->validate(['name' => '