use Illuminate\Support\Carbon; $stale_posts = Test::where(‘updated_at’, ‘<‘, Carbon::now()->subDays(7))->get(); foreach ($stale_posts as $post) { $post->delete(); }
<?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…
Read More: https://www.codeofaninja.com/2018/09/rest-api-authentication-example-php-jwt-tutorial.html
Read More: https://www.codeofaninja.com/2017/02/create-simple-rest-api-in-php.html
ssh -i pemfile.pem [email protected] scp /Downloads/wordpress-5.4.1.zip Desktop/pemfile.pem [email protected] scp -i pemfile.pem /Users/siddharthshukla/Downloads/elements-engitech-it-solutions-services-wordpress-theme-L7HQWKA-7zffMgXj-04-20/engitech.zip [email protected]:/var/www/html/wordpress/wp-content/themes unzip folder.zip
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…
Conditions using Array: $users = User::where([ ‘column1’ => value1, ‘column2’ => value2, ‘column3’ => value3 ])->get();