public function connections()
{
$relation = $this
->belongsToMany(static::class, 'connections', 'requestor_id', 'requested_id')
->withTimestamps();
/// delete the already built inner join
$relation
->getQuery() // Eloquent\Builder
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
FROM php:8.0-fpm-buster | |
# Install `docker-php-ext-install` helper to ease installation of PHP | |
# extensions | |
# | |
# Ref: https://github.com/mlocati/docker-php-extension-installer | |
ENV PHP_EXT_INSTALLER_VERSION=1.2.26 | |
RUN set -eux; \ | |
curl --fail -Lo /usr/local/bin/install-php-extensions \ |
After an apt-get upgrade on my Forge box, both php and nginx got upgraded, and while browsing my sites, PHP FPM was being hit by nginx, but it returned nothing, zilch, nada.
Nothing on laravel.log.
Something in the nginx log:
10.10.10.10 - - [23/Sep/2014:11:52:09 -0300] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
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
Blade::extend(function ($view) { | |
return preg_replace( | |
'/{{(\'|")(.*)(\'|")}}/', | |
'<?php echo e(trans($1$2$1)); ?>', | |
$view | |
); | |
}); | |
// And you should be able to do tho this on your Blade templates |
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 tables($connection = null) | |
{ | |
return collect(json_decode(json_encode(DB::connection($connection)->select(get_show_tables_query($connection))), true)) | |
->map(function ($item) { | |
return array_values($item)[0]; | |
}); | |
} | |
function get_show_tables_query($connection = null) | |
{ |
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
// in your .env file, split APP_URL to extract protocol and hostname | |
APP_PROTOCOL=https | |
APP_HOSTNAME=myapp.test | |
APP_URL="${APP_PROTOCOL}://${APP_HOSTNAME}" | |
// install dotenv | |
npm install dotenv |
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 phpx { | |
phpPath=/usr/local/etc/php/$PHP_VERSION | |
find $phpPath/php.ini $phpPath/conf.d/*.ini ! -name ext-xdebug.ini | xargs cat > $phpPath/php-no-xdebug.ini | |
php -n -c $phpPath/php-no-xdebug.ini "$@" | |
} |
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 in($needle, ...$haystack): bool | |
{ | |
foreach ($haystack as $hay) { | |
if ((is_array($hay) && in($needle, ...$hay)) || $needle == $hay) { | |
return true; | |
} | |
} | |
return false; | |
} |
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
Route::get('/sign-async-setasign', function () { | |
// Define the path to the OpenSSL executable | |
// $opensslPath = 'C:\\OpenSSL-Win32\\bin\\'; | |
$opensslPath = '/usr/bin/'; | |
// require SetaPDF | |
// require_once 'library/SetaPDF/Autoload.php'; // we are using Composer | |
date_default_timezone_set('Europe/Berlin'); |
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 clone () { | |
REPOSITORY=git@github.com:$1.git | |
echo "Cloning $REPOSITORY using SSH..." | |
git clone $REPOSITORY $2 2>/dev/null | |
if [[ $? -ne 0 ]] | |
then | |
REPOSITORY=https://github.com/$1.git | |
echo 'Falling back to HTTPS ($REPOSITORY)...' | |
git clone $REPOSITORY $2 |
NewerOlder