PHP code example of putyourlightson / laravel-datastar
1. Go to this page and download the library: Download putyourlightson/laravel-datastar 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/ */
putyourlightson / laravel-datastar example snippets
{{-- datastar/toggle.blade.php --}}
@php
$enabled = $signals->enabled;
// Do something with the state and toggle the enabled state.
$enabled = !$enabled;
@endphp
@mergesignals(['enabled' => $enabled])
@mergefragments
<span id="button-text">
{{ $enabled ? 'Disable' : 'Enable' }}
</span>
@endmergefragments