js

Thursday, January 23, 2025

PHP code to clear laravel 5.5 config

 <?php
require __DIR__ . '/vendor/autoload.php';
$app = require_once __DIR__ . '/bootstrap/app.php';

$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

try {
    echo "Clearing config cache...\n";
    $kernel->call('config:clear');

    echo "Clearing route cache...\n";
    $kernel->call('route:clear');

    echo "Clearing view cache...\n";
    $kernel->call('view:clear');

    echo "Clearing cache...\n";
    $kernel->call('cache:clear');

    echo "Regenerating JWT secret...\n";
    $kernel->call('jwt:secret', ['--force' => true]); // Regenerate JWT secret

    echo "All cache and JWT configurations cleared successfully!\n";
} catch (Exception $e) {
    echo "An error occurred: " . $e->getMessage() . "\n";
}

No comments:

Post a Comment

PHP code to clear laravel 5.5 config

 <?php require __DIR__ . '/vendor/autoload.php'; $app = require_once __DIR__ . '/bootstrap/app.php'; $kernel = $app->m...