-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclear-all.php
More file actions
31 lines (23 loc) · 950 Bytes
/
clear-all.php
File metadata and controls
31 lines (23 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* Clear ALL Laravel Caches and Enable Debug
*/
echo "<h1>Clearing Caches and Enabling Debug</h1>";
chdir(__DIR__);
// Clear all caches
echo "<h3>Clearing Caches...</h3>";
exec('php artisan config:clear 2>&1', $output);
foreach ($output as $line) echo $line . "<br>";
exec('php artisan route:clear 2>&1', $output);
foreach ($output as $line) echo $line . "<br>";
exec('php artisan cache:clear 2>&1', $output);
foreach ($output as $line) echo $line . "<br>";
exec('php artisan view:clear 2>&1', $output);
foreach ($output as $line) echo $line . "<br>";
// Update .env to enable debug
$envContent = file_get_contents('.env');
$envContent = preg_replace('/APP_DEBUG=false/', 'APP_DEBUG=true', $envContent);
file_put_contents('.env', $envContent);
echo "<h3 style='color: green;'>✓ All caches cleared and debug enabled!</h3>";
echo "<p>Now visit: <a href='/'>Home Page</a></p>";
echo "<p>You should see the detailed error now.</p>";