<?php
namespace App\Admin\FormFields;
use TCG\Voyager\FormFields\AbstractHandler;
class CustomFieldHandler extends AbstractHandler
{
If you need your woocommerce cart functions to work while inside an iframe, you have to add this code in your theme's functions file (or plugin's function file):
function iframe_cookies_samesite_filter_wc_session($enabled, $name, $value, $expire, $secure)
{
if ( ! headers_sent() ) {
setcookie($name, $value, [
'secure' => true,
'httponly' => apply_filters( 'woocommerce_cookie_httponly', $httponly, $name, $value, $expire, $secure ),
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use GuzzleHttp\Client; | |
class ProxyController extends Controller | |
{ | |
Install autorestic: https://autorestic.vercel.app/installation
Let's use /root/backup
to store our env file and autorestic config, make a data
folder inside to store the actual backups inside, and a temporary database
folder for MySQL dumps.
mkdir /root/backup
- Install Docker - https://docs.docker.com/engine/install/ubuntu/
- Install Docker-Compose - https://docs.docker.com/compose/install/#install-compose Click Linux and follow the steps
First create a domain or subdomain to use. For example video.example.com Generate ssl with letsencrypt.
If you use a ecosystem file, add the following lines to your app:
interpreter: '/home/forge/.fnm/fnm',
interpreter_args: 'exec --using=14 node',
14 is the node version. You can be more specific like --using=12.22.4
Example configuration:
If you want to use bavix/laravel-wallet plugin with a one-time inline defined product, here is how to do it:
- Create a fake model for it
app/Models/InlineProduct.php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/resources/views/vendor/backpack/crud/fields/dependent_text.blade.php
{{-- dependent text input --}}
@php
$field['wrapper'] = $field['wrapper'] ?? $field['wrapperAttributes'] ?? [];
$field['wrapper']['data-field-name'] = $field['wrapper']['data-field-name'] ?? $field['name'];
$field['wrapper']['data-depends-on'] = json_encode($field['depends_on'] ?? []);
$field['wrapper']['data-init-function'] = $field['wrapper']['data-init-function'] ?? 'bpFieldInitDependentTestElement';
app/Logging/AxiomLogger.php
<?php
namespace App\Logging;
use Http;
use Monolog\Logger;
use Monolog\Handler\HandlerInterface;
#!/bin/bash | |
USER_NAME=app | |
cat /etc/passwd | grep ${USER_NAME} >/dev/null 2>&1 | |
if [ $? -eq 0 ] ; then | |
echo "user ${USER_NAME} exists" | |
else | |
groupadd -r ${USER_NAME} -g 1000 && useradd -u 1000 -r -g ${USER_NAME} -m -d /home/${USER_NAME} -s /bin/bash -c "App user" ${USER_NAME} | |
fi |