This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For more information: https://laravel.com/docs/sail | |
# The reciever app (the one that will recieve calls from the other laravel app) | |
# app-one sail up -d | |
# app-one_laravel.test_1 start-container | |
# Shutting down old Sail processes... | |
# Creating network "app-one_sail" with driver "bridge" | |
# Creating network "app-one_app-shared" with driver "bridge" | |
# Creating mysql_app_one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TmpFile extends SplTempFileObject | |
{ | |
public function store(string $filename): void | |
{ | |
file_put_contents($filename, $this->getContents()); | |
} | |
public function getContents(): ?string | |
{ | |
$this->rewind(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tobe inserted in AppServiceProvider@boot method | |
Blade::directive('selected', function ($expression) { | |
return "<?php echo {$expression} ? 'selected' : ''; ?>"; | |
}); | |
Blade::directive('checked', function ($expression) { | |
return "<?php echo {$expression} ? 'checked' : ''; ?>"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isElementInViewport(el) { | |
var rect = el.getBoundingClientRect(); | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | |
rect.right <= (window.innerWidth || document.documentElement.clientWidth) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{HTTP:X-Forwarded-Port} ^80$ | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
# Serve the file if it's actually a file on the server | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] |