PHP code example of thibaud-dauce / phpstan-blade

1. Go to this page and download the library: Download thibaud-dauce/phpstan-blade 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/ */

    

thibaud-dauce / phpstan-blade example snippets


/** @var ?User */
$user = null;

return view('user', [
    'user' => $user,
]);
json
{
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ],
        "phpstan": [
            "@php artisan phpstan-blade:touch-cache",
            "./vendor/bin/phpstan analyse --error-format blade"
        ]
    },
}
blade
@php
    /** @var string */
    $name = config('app.name');
@endphp

{{ $name }}
blade
@php
    /** @var string $name */
    $name = config('app.name');
@endphp

{{ $name }}