1. Go to this page and download the library: Download laravel/chisel 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/ */
laravel / chisel example snippets
aravel\Chisel\Chisel;
use Laravel\Chisel\Question;
return Chisel::script(dirname(__DIR__))
->questions([
Question::multiselect(
name: 'auth_features',
label: 'Which authentication features would you like to enable?',
options: [
'email-verification' => 'Email verification',
],
hint: 'Use space to select, enter to confirm.',
),
])
->selected('auth_features', 'email-verification',
then: function (Chisel $c) {
$c->files(
'resources/js/pages/settings/profile.tsx',
'app/Providers/FortifyServiceProvider.php',
)->removeSectionMarkers('email-verification');
},
else: function (Chisel $c) {
$c->php('app/Models/User.php')
->removeImport('Illuminate\Contracts\Auth\MustVerifyEmail')
->removeInterface('MustVerifyEmail');
$c->file('config/fortify.php')->removeLinesContaining('Features::emailVerification()');
$c->files(
'app/Providers/FortifyServiceProvider.php',
'resources/js/pages/settings/profile.tsx',
)->removeSection('email-verification');
$c->files(
'resources/js/components/email-verification-notice.tsx',
'resources/js/pages/auth/verify-email.tsx',
'tests/Feature/Auth/EmailVerificationTest.php',
'tests/Feature/Auth/VerificationNotificationTest.php',
)->delete();
},
);
use Illuminate\Console\Command;
use Laravel\Chisel\Chisel;
use Laravel\Chisel\Question;
use RuntimeException;
use function Laravel\Prompts\multiselect;
class InstallFeatures extends Command
{
protected $signature = 'install:features
{--answers= : JSON string of answers to skip interactive prompts}';
public function handle(): void
{
$script = label: $question->label,
options: $question->options,
default: $question->default ?? [],