PHP code example of m-derakhshi / laravel-php-security

1. Go to this page and download the library: Download m-derakhshi/laravel-php-security 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/ */

    

m-derakhshi / laravel-php-security example snippets


// In web.php
Route::get('/security-check', [SecurityCheckController::class, 'index']);



namespace App\Http\Controllers;

use MDerakhshi\SecurityCheck\LaravelPHPSecurityCheck;

class SecurityCheckController extends Controller
{
    public function index(LaravelPHPSecurityCheck $securityCheck)
    {
        $result = $securityCheck->checkSettings();
        return view('laravel-php-security-check::laravel-php-security-check', $result);
    }
}
bash
php artisan vendor:publish --tag=views --provider="MDerakhshi\SecurityCheck\LaravelPHPSecurityServiceProvider"