Author

Siddharth Shukla

Browsing

<?php header(‘Content-type: application/excel’); $filename = ‘filename.xls’; header(‘Content-Disposition: attachment; filename=’.$filename); $data = ‘<html xmlns:x=”urn:schemas-microsoft-com:office:excel”> <head> <title>Page Title</title> </head> <body> <table><tr><td>Cell 1</td><td>Cell 2</td></tr></table> </body></html>’; echo $data; ?>

In folder config => database.php make sure mysql strict is false, like this ‘mysql’ => [ ‘driver’ => ‘mysql’, ‘url’ => env(‘DATABASE_URL’), ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’), ‘port’ => env(‘DB_PORT’, ‘3306’), ‘database’ => env(‘DB_DATABASE’, ‘forge’), ‘username’ => env(‘DB_USERNAME’, ‘forge’), ‘password’ => env(‘DB_PASSWORD’, ”), ‘unix_socket’ => env(‘DB_SOCKET’, ”), ‘charset’ => ‘utf8mb4’, ‘collation’ => ‘utf8mb4_unicode_ci’, ‘prefix’ => ”, ‘prefix_indexes’ => true, ‘strict’ => false, ‘engine’ => null, ‘options’ => extension_loaded(‘pdo_mysql’) ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env(‘MYSQL_ATTR_SSL_CA’), ]) : [], ], if strict is true, make it…

Here is my configuration to make HTTPS working with assets. To enable this in production add REDIRECT_HTTPS=true in the .env file. REDIRECT_HTTPS=true <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { if(env(‘REDIRECT_HTTPS’)) { \URL::forceScheme(‘https’); } Schema::defaultStringLength(191); } /** * Register any application services. * * @return void */ public function register() { // } }

HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes: Informational responses (100–199), Successful responses (200–299), Redirects (300–399), Client errors (400–499), and Server errors (500–599). Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

Http to Https in laravel Move .htaccess file from public folder to root directory and Rename server.php to index.php <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> Options +FollowSymLinks RewriteEngine On RewriteBase / # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder… RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller… RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php…