I added this variable to .env file
STRIPE_SECRET=a12345
I would like to dump the variable using routes/web.php
&
First, there is no STRIPE_SECRET inside your .env file(As per before edit the question). So please make sure that your .env must have this variable. You should clear your configuration cache by executing following commands in the same order
php artisan config:cache
php artisan config:clear
Laravel cache your configuration files so the execution become faster. So everytime when you change the configuration files on server, you should clear the cache.
Additionally you can run these commands also to clear the other caches
php artisan cache:clear //for clearing the cache
php artisan view:clear //for clearing the compiled views
php artisan route:clear //for clearing the routes cache
You can also create the routes for these commands and call the commands from the code also as
Route::get('/cache-clear', function() {
$exitCode = Artisan::call('cache:clear');
echo "Cache Cleard: ".$exitCode;
});
Route::get('/view-clear', function() {
$exitCode = Artisan::call('view:clear');
echo "View Cleard: ".$exitCode;
});
Route::get('/route-cache', function() {
$exitCode = Artisan::call('route:cache');
echo "Route Cached: ".$exitCode;
});
Route::get('/route-clear', function() {
$exitCode = Artisan::call('route:clear');
echo "Route Cache Cleared: ".$exitCode;
});
Route::get('/config-cache', function() {
$exitCode = Artisan::call('config:cache');
echo "Config Cached: ".$exitCode;
});
Route::get('/config-clear', function() {
$exitCode = Artisan::call('config:clear');
echo "Config Cache Cleared: ".$exitCode;
});