Code Highlighting
<?php
declare(strict_types=1);
namespace App\Actions\Fortify;
use App\Concerns\PasswordValidationRules;use App\Concerns\ProfileValidationRules;use App\Models\User;use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Validator;use Laravel\Fortify\Contracts\CreatesNewUsers;
class CreateNewUser implements CreatesNewUsers{ use PasswordValidationRules; use ProfileValidationRules;
/** * Validate and create a newly registered user. * * @param array<string, string> $input */ public function create(array $input): User { Validator::make($input, [ ...$this->profileRules(), 'surname' => $this->surnameRules(), 'password' => $this->passwordRules(), ])->validate();
return DB::transaction(function () use ($input): User { $user = User::create([ 'name' => $input['name'], 'surname' => $input['surname'], 'email' => $input['email'], 'password' => $input['password'], 'username' => $input['username'], 'legacy_id' => $input['legacy_id'], ]);
$user->assignRole('customer');
return $user; }); }}Apply these values as the new defaults in the useDialKit call.
Code block highlighting reference
Section titled “Code block highlighting reference”Plaintext substring marker
Section titled “Plaintext substring marker”Highlights every occurrence of the given text, not full lines.
$user->assignRole('customer');$user->assignRole('customer');Typed variants: mark="text", ins="text", del="text".
'username' => $input['username'],'legacy_id' => $input['legacy_id'],Regexp marker
Section titled “Regexp marker”Same as plaintext, but wrapped in slashes.
$user->assignRole('customer');Diff-like +/- syntax
Section titled “Diff-like +/- syntax”No line numbers needed — prefix lines directly. Add lang="php" (or any lang) to keep syntax highlighting instead of falling back to diff.
$user = User::create([ 'name' => $input['name'], 'legacy_id' => $input['legacy_id'], 'username' => $input['username'],]);Filename / title
Section titled “Filename / title”class CreateNewUser implements CreatesNewUsers{}Terminal frame
Section titled “Terminal frame”php artisan migrateCollapse a line range
Section titled “Collapse a line range”Collapses lines 2-4 behind a “show more” toggle.
<?php3 collapsed lines
use App\Concerns\PasswordValidationRules;use App\Concerns\ProfileValidationRules;
class CreateNewUser{}Word wrap instead of horizontal scroll
Section titled “Word wrap instead of horizontal scroll”$user = User::create(['name' => $input['name'], 'surname' => $input['surname'], 'email' => $input['email']]);Disable line numbers for one block
Section titled “Disable line numbers for one block”Overrides the global showLineNumbers setting for a single fence.
$user->assignRole('customer');Re-collapsible block (native <details>)
Section titled “Re-collapsible block (native <details>)”The collapse plugin’s toggle is one-way — once expanded it stays open. For a block that can be closed again, wrap it in raw HTML <details>/<summary> instead of using collapse={}.
Show migration command
php artisan migrate