Explanation
Explanation
\ \ \ \
\ \ \ `-- Call seeders.
\ \ `-- Drop all tables and run migrations.
\ `-- General command.
`-- ?
cd {SITE_DIRECTORY}
{SITE_PHP} artisan up
echo "🚀 Application deployed!"
# Runs the database seeder and seeds the database with sample data
php artisan db:seed
Declare all the files that would be included to include requests and combine them
in a single file
php artisan optimize --force
Composer scan the application and create a one-to-one association of the classes
and files in the application
composer dumpautoload -o
// for migration
php artisan migrate
// Key Generation
php artisan key:generate
// Server Start
php artisan serve
// To controller create
php artisan make:controller Api/TourController (edited)
[Generate a key]
php artisan key:generate
[Cache the configuration file (update the cache in bootstrap/cache/config.php)]
php artisan config:cache
[Cache the routing definition]
php artisan route:cache
[List the cached routing definition]
php artisan route:list
[Create a controller]
php artisan make:controller HelloController
[Create a form request app/Http/Requests/ContactRequest/]
php artisan make:request ContactRequest
composer dump-autoload
##### Direct to project folder #########
sudo chown -R www-data:www-data /var/www/sump/
# Clear cache
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php-timezone.php
<?php
$items = [];
array_push($items, ["key" => "Current Date T", "value" => date('Y-m-d H:i:s
T')]);
array_push($items, ["key" => "Current Date", "value" => $date = date('Y-m-d
H:i:s')]);
array_push($items, ["key" => "LOCALE TIMESTAMP: ", "value" =>
strtotime($date)]); // true
array_push($items, ["key" => "UTC TIMESTAMP: ", "value" => strtotime($date."
UTC")]); // wrong
array_push($items, ["key" => "TIME", "value" => time()]);
array_push($items, ["key" => "BD from LOCALE", "value" => strtotime("1992-01-28
02:00:00")]); // 696556800
array_push($items, ["key" => "BD from UTC 00:00:00", "value" =>
strtotime("1992-01-28 00:00:00 UTC")]); // 696556800
array_push($items, ["key" => "GMT Date", "value" => $gmtdate = gmdate("Y-m-d T
H:i:s", 1517832507)]);
array_push($items, ["key" => "Date", "value" => date('d-m-Y T H:i:s',
1517832507)]);
array_push($items, ["key" => "UTC TIME", "value" => strtotime($gmtdate."
UTC")]);
array_push($items, ["key" => "UTC TIME", "value" => strtotime($gmtdate)]);
echo "<table>";
foreach ($items as $item){
echo "<tr>";
echo "<td><strong>{$item['key']}</strong></td>";
echo "<td>{$item['value']}</td>";
echo "</tr>";
}
echo "</table>";
?>
1: Set up two-step authentication for your Google account.
2: Generate an app password
https://security.google.com/settings/security/apppasswords
3: Add to .env
4: Send a test email
php artisan tinker
>>> Mail::raw('test mail',function($message) {$message->to('[email protected]')-
>subject('test');});
>>> Mail::send('email.contact', ['name' => 'meta','text'=>'test'],
function($message){ $message->to('[email protected]')->subject('test'); });
If an error occurs
Debug information
dd(\Config::get('mail'));
-------
dir /AL /S C:\
/A displays all files with a specific attribute, and L specifies reparse points
(symlinks and directory junctions)
/S makes the command recursive
replace C:\ with the drive letter you want to scan, or with a path if you don't
want to scan an entire drive
Linux
ln -s laravel/public public_html
php artisan module:make Blog User Auth module:use Use a given module. This allows
you to not specify the module name on other commands requiring the module name as
an argument.
php artisan module:use Blog module:unuse This unsets the specified module that was
set with the module:use command.
php artisan module:migrate-reset Blog module:seed Seed the given module, or without
an argument, seed all modules
The Policies is not generated by default when creating a new module. Change the
value of paths.generator.policies in modules.php to your desired location.
The Rules folder is not generated by default when creating a new module. Change the
value of paths.generator.rules in modules.php to your desired location.
The Transformers folder is not generated by default when creating a new module.
Change the value of paths.generator.resource in modules.php to your desired
location.
$table->string('email')->unique();
$table->unique('email');
```
CLEAR ALL BROWSERS:
erase "%TEMP%\*.*" /f /s /q
for /D %%i in ("%TEMP%\*") do RD /S /Q "%%i"
erase "%TMP%\*.*" /f /s /q
for /D %%i in ("%TMP%\*") do RD /S /Q "%%i"
erase "%ALLUSERSPROFILE%\TEMP\*.*" /f /s /q
for /D %%i in ("%ALLUSERSPROFILE%\TEMP\*") do RD /S /Q "%%i"
erase "%SystemRoot%\TEMP\*.*" /f /s /q
for /D %%i in ("%SystemRoot%\TEMP\*") do RD /S /Q "%%i"
pause
$ cat .htaccess_production
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Redirect to https
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,N]
<IfModule mod_headers.c>
# Activate HSTS
Header always set Strict-Transport-Security "max-age=31536000;
includeSubDomains; preload;"