Remove strike through line and prepend text to price

I’ve got these two snippets from a good source they both work.
But I’m trying to hide strike out only not rrp price. Also I’m trying to prepend rrp and sales price with text. So both rrp and sales price should show, but both be prependeded withncustom text.

add_filter(‘woocommerce_get_price_html’, ‘hide_strikethrough_price’, 100, 2);

function hide_strikethrough_price($price, $product) {
if (is_admin() || !is_shop() && !is_product() && !is_product_category()) {
    return $price;
}

if ($product->is_on_sale() && $product->get_regular_price() !== $product->get_price()) {
    return wc_price($product->get_sale_price());
}

return $price;

}

if( !function_exists("add_custom_text_prices") ) {
function add_custom_text_prices( $price, $product ) {
    // Text
    $text_regular_price = __("Non-members: ");
    $text_final_price = __("Members only: ");

    if ( $product->is_on_sale() ) {
        $has_sale_text = array(
          '<del>' => '<del>' . $text_regular_price,
          '<ins>' => '<br>'.$text_final_price.'<ins>'
        );
        $return_string = str_replace(
            array_keys( $has_sale_text ), 
            array_values( $has_sale_text ), 
            $price
        );

        return $return_string;
    }
    return $text_regular_price . $price;
}
add_filter( 'woocommerce_get_price_html', 'add_custom_text_prices', 100, 2 );

}

Website Looks perfect in Firefox but Fails in Chrome [closed]

I created a website for my son’s business in 2007. It looks perfect in Firefox but the Left column with the Menu and a graphic, instead of floating to the left of the main column, have shifted down below the content of the page. It’s pretty old school. My son died last weekend and I thought I’d fire it up for his friends and our family could see his logging business and photos.
Here is the website:
https://clairepoulton.com/fosters-logging

I did template it using PHP HEREDOC

I believe the problem is in the css file but I can’t find it even using the Chrome Inspector

https://clairepoulton.com/fosters-logging/styles/fosters.css

Docker (compose) php apache. Imagick with heic support [closed]

We’re running a website for our community on docker (compose) and now we would like to enable heic support for imagick such that apple users can upload images which are then converted to jpeg.

We have been able to enable imagick and gd support but heic is another issue.

FROM php:8.1-apache

RUN a2enmod rewrite 

# Install system dependencies
RUN apt-get update && apt-get install -y 
      git 
      libicu-dev 
      libc-client-dev
      zlib1g-dev 
      g++
      libpq-dev 
      libmcrypt-dev 
      git 
      libkrb5-dev

# Install system dependencies for zipping
RUN apt-get install -y 
      libzip-dev 
      zip 
      unzip

# Install system deps for imagick
RUN apt-get install -y 
      libpng-dev 
      libjpeg-dev 
      libwebp-dev 
      libfreetype6-dev 
      libonig-dev 
      libxml2-dev 
      libheif-dev 
      libde265-dev 
      imagemagick 
      libmagickwand-dev 
      && rm -rf /var/lib/apt/lists/*

# Install PHP extensions
RUN docker-php-ext-install pdo pdo_mysql mysqli
RUN docker-php-ext-configure intl
RUN docker-php-ext-install 
      intl
      # mbstring 
      # curl 
      # json 
      # zip
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && docker-php-ext-install imap && docker-php-ext-enable imap

# Install PHP GD extension
RUN apt-get install -y zlib1g-dev libpng-dev libjpeg-dev
RUN docker-php-ext-configure gd 
      --with-jpeg 
      --with-freetype 
      && docker-php-ext-install gd

# Install PHP Imagick extension via PECL and enable it
RUN apt-get update && apt-get install -y libmagickwand-dev 
    && pecl install imagick 
    && docker-php-ext-enable imagick

RUN convert -list format | grep HEIC || echo "HEIC format not found in ImageMagick"


# RUN usermod -u ${uid} www-data 
#     && groupmod -g ${uid} www-data;

My test code:

<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['image'])) {
    $fileTmp = $_FILES['image']['tmp_name'];
    $fileExt = strtolower(pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION));

    $imagick = new Imagick($fileTmp);
    
}
?>

<!DOCTYPE html>
<html>
<head><title>HEIC to JPEG</title></head>
<body>
    <h1>Upload HEIC Image</h1>
    <form method="post" enctype="multipart/form-data">
        <input type="file" name="image" accept=".heic">
        <button type="submit">Convert to JPEG</button>
    </form>
</body>
</html>

The issue:
Fatal error: Uncaught ImagickException: Invalid filename provided in /var/www/html/upload-test.php:8 Stack trace: #0 /var/www/html/upload-test.php(8): Imagick->__construct('') #1 {main} thrown in /var/www/html/upload-test.php on line 8

We can’t find “a simple solution” that is like enabling gd or imagick with heic but only solutions that require us to build imagick from source and then enable heic.

Is doing so, by building from source and enabling heic, the only possible method?
What is a good alternative for converting iphone images to jpeg / png on our website with ease or enabling imagick to convert heic to jpeg format with ease?

Import variable products in Wocommers

I’m importing variable products into WooCommerce using a CSV file.
Each product uses a global attribute called pa_size and variations have their values like S, M, L, L-XL, etc.

The problem I’m facing is this:

When I define the parent product with Attribute 1 value(s): S|M|L and set:

Attribute 1 global: 1

Attribute 1 variation: 1

WooCommerce adds all those values (S|M|L) to the global attribute, which is already created.
The global attribute ends up “polluted” with extra sizes.

Because of this, the variants get set to any-size for pa_size.

Attribute: pa_color: Blue
Attribute: pa_size: M
Attribute: pa_size: S

This will be any_size Blue
This will be any_size Blue

I would like to:
Each variation should be linked to only the exact global term (like S, M)
The parent should not “inject” extra values into the global attribute term list
No custom attributes — everything should stay linked to pre-created global values

Did anyone else have a similar problem?

Attribute Accessors not working after laravel app upgrade

Laravel accessor not working after I upgraded from v8.75 to v11.31

I had this LARAVEL v8.75 App where in the User model I created an Accessor for photo like below

public function getPhotoAttribute($value)
    {
        // Default Photo
        $defaultPhotoUrl = mediaUrl('assets/user.png');

        return !empty($value) && $value != 'undefined' ? (new FileHelper)->getFileUrl($value) : $defaultPhotoUrl;
    }

with the intention of setting the user default image where it’s null, but after my upgrade to v11.31, I noticed empty photos are returned as null instead of with the default image

I went through the documentation and noticed that the syntax was changed. then I upgraded the function to:

     /**
     * Interact with the user's photo.
     */
    protected function photo(): Attribute
    {
        return Attribute::make(
            get: fn (string $value) => (!empty($value) && $value != 'undefined' ? (new FileHelper)->getFileUrl($value) :mediaUrl('assets/user.png')),
        );
    }

but yet no result

Filamentphp v3 hide RenderHook if sidebar is collapsed

How do I hide a custom blade (PanelsRenderHook) on my sidebar if sidebar is collapsed.

class AppServiceProvider extends ServiceProvider
{
   
    public function register(): void
    {
   
    }

    
    public function boot(): void
    {
       FilamentView::registerRenderHook(
            PanelsRenderHook::SIDEBAR_NAV_START,
            fn (): string => Blade::render(
                <<<'BLADE'
                    @livewire('panel-title', ['panelId' => $panelId])
                BLADE,
                ['panelId' => Filament::getCurrentPanel()->getId()]
            ),
        );

PHP mysql_pdo can’t connect to 127.0.0.1

I try to connect to MariaDB running in Docker/Podman. pdo_mysql can connect to the container’s (random) private IP address but fails to connect to 127.0.0.1. How to fix that?

This is how I started MariaDB:

$ sudo docker run --rm -p 3306:3306 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 mariadb

MariaDB is listening on 0.0.0.0:

$ ss -l --tcp
State         Recv-Q        Send-Q                 Local Address:Port                   Peer Address:Port        Process        
LISTEN        0             4096                         0.0.0.0:mysql                       0.0.0.0:*
...

The Docker container’s IP address:

$ sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' 2eae8784e05a
172.17.0.2

MariaDB is reachable with mysql both as 127.0.0.1 and the container’s IP address:

$ echo "SELECT VERSION()" | mysql -h 127.0.0.1  -P 3306 -u root
VERSION()
11.7.2-MariaDB-ubu2404
$ echo "SELECT VERSION()" | mysql -h 172.17.0.2 -P 3306 -u root
VERSION()
11.7.2-MariaDB-ubu2404

When I try to configure my Symfony app with 127.0.0.1 instead of (random) Docker container IP address it fails to connect:

DATABASE_URL=mysql://[email protected]/MyDatabase?charset=utf8mb4&serverVersion=mariadb-11.5.2

The log says:

[2025-06-12T11:22:05.043222+02:00] doctrine.INFO: Connecting with parameters array{"use_savepoints":true,"dbname_suffix":"_test","driver":"pdo_mysql","idle_connection_ttl":600,"host":"127.0.0.1","port":null,"user":"root","password":null,"driverOptions":[],"defaultTableOptions":[],"charset":"utf8mb4","serverVersion":"mariadb-11.5.2"} {"params":{"use_savepoints":true,"dbname_suffix":"_test","driver":"pdo_mysql","idle_connection_ttl":600,"host":"127.0.0.1","port":null,"user":"root","password":null,"driverOptions":[],"defaultTableOptions":[],"charset":"utf8mb4","serverVersion":"mariadb-11.5.2"}} [] [2025-06-12T11:22:05.045866+02:00] console.CRITICAL: Error thrown while running command "doctrine:database:create --env=test --if-not-exists". Message: "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused" {"exception":"[object] (Doctrine\DBAL\Exception\ConnectionException(code: 2002): An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused at /src/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:80)n[previous exception] [object] (Doctrine\DBAL\Driver\PDO\Exception(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /src/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)n[previous exception] [object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /src/vendor/doctrine/dbal/src/Driver/PDO/PDOConnect.php:23)","command":"doctrine:database:create --env=test --if-not-exists","message":"An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused"} []

Why does pdo_mysql fail with “connection refused” when the mysql command proves that a connection can be made to that IP address?

I know that localhost is a special keyword that doesn’t resolve to 127.0.0.1 but triggers connection to a Unix socket. Is the some special handling for 127.0.0.1 as well?

Edit:

PHP is running natively on the host to reduce complexity.

As requested in the comments I wrote the most basic PHP script to check if the problem is with Symfony—it’s not.

<?php

$conn = new PDO('mysql:host=172.17.0.2', null, null, null);

For the Docker container’s IP address it says (like expected):

PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user ''@'172.17.0.3' (using password: NO) in /src/connect.php:3

For 127.0.0.1 it says (this is the very issue of this question):

PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused in /src/connect.php:3

How should dynamic Gutenberg blocks work with page caching?

I have a custom dynamic Gutenberg block staff-group that retrieves data from staff posts in its render.php file via get_posts().

If one of the staff posts is updated, the block naturally reflects the latest content. However, this doesn’t work with my web host’s page caching. The page containing the block is cached, and it doesn’t know when the staff posts have been updated.

What is the recommended way to manage this?

I attempted to rework the block to take advantage of the render_callback pattern, but it did not seem to change anything. I guess I was hope a “dynamic” block would be truly dynamic and have some built-in magic to trigger a refresh.

The obvious solutions are:

  1. Update the frontend of the block on the client (via JS).
  2. Identify pages where the block has been used, and exclude them from the caching mechanism.

#2 could be done manually, by adding the paths to an exclude list, or dynamically, via a function that runs when the custom post type is saved. My host has a special path that can be accessed via wp_remote_get() to clear a specific page. But I’ll probably go with #1.

Am I missing something? Surely a lot of people are using blocks like Query Loop on multiple pages, or Synced Patterns, and not excluding those pages from their cache. Or do other hosts have better caching strategies?

Thanks for your help!

Symfony with doctrine ORM3 on a php 8.4 environement: LazyGhostTrait deprecation message

I’m currently using symfony 7.3 with php 8.4.
And I’m trying to fix the following deprecation message:

Since symfony/var-exporter 7.3: The “SymfonyComponentVarExporterLazyGhostTrait” trait is deprecated, use native lazy objects instead.

I’m not using LazyGhostTrait in my code, the only reference to the keyword lazy is on the doctrine.yaml file

enable_lazy_ghost_objects: true

But unfortunately when I try to set it to false I’m having the following feedback

Lazy ghost objects cannot be disabled for ORM 3.

So, I guess I cannot do anything about my initial deprecation message, unless I missed something?
Any hints ?

Why does exporting 92k rows of data using PHPSpreadsheet not leak memory, even with unlimited execution time and memory? [closed]

I’m working on a data export functionality in Laravel and need to export a large dataset, approximately 92,000 rows. I’m using PHPSpreadsheet for the export, and I’ve explicitly set the following PHP configurations to avoid any limitations during the export process:

  • max_execution_time = -1 (no execution time limit)

  • memory_limit = 0 (no memory limit)

Despite this, I’ve noticed that the memory usage does not increase significantly during the export, and there’s no memory leak, which is unexpected given the large dataset.

I expected that exporting such a large number of rows without using streaming would lead to high memory usage or even cause memory leaks, but that doesn’t seem to be the case.

Here’s what I’ve tried so far:

  • I’m using PHPSpreadsheet for the export process.
  • I have set max_execution_time = -1 and memory_limit = 0 to remove any limits.

I haven’t implemented chunking or streaming in the process, and I’m not using the stream concept for exporting.

Can anyone explain why this is happening? Is there something in the way PHPSpreadsheet or Laravel handles large exports that prevents memory leaks in this scenario, or am I missing something?

Laratrust 8.5 isAbleTo() method causing Call to a member function setRelation() on null error after upgrading from Laravel 8 to Laravel 10

I recently upgraded my Laravel project from Laravel 8 to Laravel 10 and Laratrust 7 to Laratrust 8.5. After the upgrade, I encountered an issue when using the isAbleTo() method from Laratrust. The error I am getting is

Call to a member function setRelation() on null

This error occurs when I try to check if a user has a specific permission in my controller using the following code:

if (!$request->user()->isAbleTo('dashboard-widget-box-sale-read')) {
    return $this->CommonUtils->sendError(null, __('common.unauthorized_action'), $request->bearerToken());
}

Here is my User Model:

<?php

namespace AppModels;

use AppTraitsUserstamps;
use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateFoundationAuthUser as Authenticatable;
use IlluminateNotificationsNotifiable;
use LaratrustContractsLaratrustUser;
use LaratrustTraitsHasRolesAndPermissions;
use LaravelFortifyTwoFactorAuthenticatable;
use LaravelJetstreamHasProfilePhoto;
use LaravelSanctumHasApiTokens;

class User extends Authenticatable implements LaratrustUser
{
    use HasApiTokens, HasFactory, HasProfilePhoto, Notifiable, TwoFactorAuthenticatable, Userstamps;
    use HasRolesAndPermissions;
}

Role:

<?php

namespace AppModels;

use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateSupportStr;
use LaratrustModelsRole as RoleModel;
use OwenItAuditingContractsAuditable;
use AppTraitsUserstamps;

class Role extends RoleModel implements Auditable
{
    use HasFactory, Userstamps;
}

Permission

<?php

namespace AppModels;

use IlluminateDatabaseEloquentFactoriesHasFactory;
use LaratrustModelsPermission as PermissionModel;
use OwenItAuditingContractsAuditable;
use AppTraitsUserstamps;

class Permission extends PermissionModel implements Auditable
{
    use HasFactory, Userstamps;
}

ERROR LOG

{
    "message": "Call to a member function setRelation() on null",
    "exception": "Error",
    "file": "/var/www/html/83/medbox-core-api/vendor/santigarcor/laratrust/src/Checkers/User/UserDefaultChecker.php",
    "line": 219,
    "trace": [
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/santigarcor/laratrust/src/Checkers/User/UserDefaultChecker.php",
            "line": 130,
            "function": "hidrateRole",
            "class": "Laratrust\Checkers\User\UserDefaultChecker",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/santigarcor/laratrust/src/Traits/HasRolesAndPermissions.php",
            "line": 191,
            "function": "currentUserHasPermission",
            "class": "Laratrust\Checkers\User\UserDefaultChecker",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/santigarcor/laratrust/src/Traits/HasRolesAndPermissions.php",
            "line": 217,
            "function": "hasPermission",
            "class": "App\Models\User",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/app/Http/Controllers/Reports/DashboardController.php",
            "line": 134,
            "function": "isAbleTo",
            "class": "App\Models\User",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
            "line": 54,
            "function": "dashboardActions",
            "class": "App\Http\Controllers\Reports\DashboardController",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
            "line": 43,
            "function": "callAction",
            "class": "Illuminate\Routing\Controller",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 259,
            "function": "dispatch",
            "class": "Illuminate\Routing\ControllerDispatcher",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 205,
            "function": "runController",
            "class": "Illuminate\Routing\Route",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 806,
            "function": "run",
            "class": "Illuminate\Routing\Route",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 144,
            "function": "Illuminate\Routing\{closure}",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/app/Http/Middleware/CheckBranchId.php",
            "line": 36,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "App\Http\Middleware\CheckBranchId",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/app/Http/Middleware/CheckBusinessId.php",
            "line": 35,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "App\Http\Middleware\CheckBusinessId",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/app/Http/Middleware/SwitchDatabase.php",
            "line": 53,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "App\Http\Middleware\SwitchDatabase",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
            "line": 50,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Routing\Middleware\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php",
            "line": 41,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Session\Middleware\AuthenticateSession",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 159,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 125,
            "function": "handleRequest",
            "class": "Illuminate\Routing\Middleware\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 87,
            "function": "handleRequestUsingNamedLimiter",
            "class": "Illuminate\Routing\Middleware\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Routing\Middleware\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",
            "line": 57,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Auth\Middleware\Authenticate",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php",
            "line": 25,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 144,
            "function": "Laravel\Sanctum\Http\Middleware\{closure}",
            "class": "Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 119,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php",
            "line": 24,
            "function": "then",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 119,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 805,
            "function": "then",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 784,
            "function": "runRouteWithinStack",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 748,
            "function": "runRoute",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 737,
            "function": "dispatchToRoute",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 200,
            "function": "dispatch",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 144,
            "function": "Illuminate\Foundation\Http\{closure}",
            "class": "Illuminate\Foundation\Http\Kernel",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/app/Http/Middleware/CheckPlatform.php",
            "line": 24,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "App\Http\Middleware\CheckPlatform",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
            "line": 31,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
            "line": 40,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\TrimStrings",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
            "line": 99,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php",
            "line": 62,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Http\Middleware\HandleCors",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php",
            "line": 39,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 183,
            "function": "handle",
            "class": "Illuminate\Http\Middleware\TrustProxies",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 119,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 175,
            "function": "then",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 144,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\Foundation\Http\Kernel",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/public/index.php",
            "line": 51,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Kernel",
            "type": "->"
        },
        {
            "file": "/var/www/html/83/medbox-core-api/server.php",
            "line": 21,
            "function": "require_once"
        }
    ]
}
  1. User Authentication: I have confirmed that the user is authenticated and the roles and permissions are assigned correctly.

  2. Permissions Check: The role owner has the permission dashboard-widget-box-sale-read.

  3. Cache Clear: I’ve cleared the application cache and configuration cache

  4. Laratrust Configuration: I’ve also ensured that the Laratrust configuration is correct as per the official documentation.

Has anyone else experienced this issue after upgrading to Laravel 10 and Laratrust 8.5? Any suggestions for troubleshooting this error or resolving it?

write <td style= in .css file [duplicate]

I have this element

<td style="text-align: center; font-size: 11px; background-color: <?php echo $color ?>;">xxx</td>

where $color changes according to the value of xxx.
Since its a long line I would like put it into a .css file
Is it possible?

How to pass column with variable to a component’s slot in Laravel blade?

Im using to Laravel blade’s component to make a dynamic table, in which user can pass in header, and corresponding rows. I wanna use this component to display many tables (permissions, reviews, etc…). I use it in my view like this

                <x-admin.data-table :items="$review" route="admin/users">
                    <x-slot:header>
                        <th>Name</th>
                        <th>Description</th>
                    </x-slot>
                    <x-slot:row :item="$item">
                        <td>{{$item->name}}</td>
                        <td>{{$item->description}}</td>
                    </x-slot:row>
                </x-admin.data-table>

The row slot is display in data-table.blade.php like this

<tbody>
@foreach ($items as $item)
   <tr>
      {{ $row(['item' => $item]) }}
   </tr>
@endforeach
</tbody>

This part

                    <x-slot:row :item="$item">
                        <td>{{$item->name}}</td>
                        <td>{{$item->description}}</td>
                    </x-slot:row>

this is where people want to reuse this component, can pass their own attribute, i.e <td>{{$item->content}}</td>.
But what i get is Undefined variable $item. I tried using {{ $row->with(['item' => $item]) }} too, but still a no. How should I pass the columns to my slot then?

Google’s Blogger V3 api oAuth not working anymore

I have been using the Blogger V3 api for many years. I use the official googleapis.com PHP library to retreive data and take care of the oAUth2 flow. Since a couple of days I cannot let users authorize my app anymore.

I did a lot of debugging and reading on the internet and here are my findings:

  • The access_token that I receive after a user has authorized us through the oAuth permission screen, is valid. I can use the Google library to fetch the userinformation with it. ( $oauth = new Google_Service_Oauth2($client); $userinfo = $oauth->userinfo->get(); )

  • The access_token is validated fine when using https://oauth2.googleapis.com/tokeninfo?access_token={token}

  • I can perfectly fetch Blogger information and content in the Google Playground when I enter the access_token that I have retreived using the oAuth flow on my server. So the access_token seems to work within the Google environment itself.

  • However, when I try to request the Blogger V3 api from my server, I keep bumping into an 403 error. For example: “Your client does not have
    permission to get URL /v3/blogs/byurl from this server. That’s all we know.”

  • Sending direct curl requests with the access_token as bearer in the Authorization header returns the same error.

I’m really lost. There are no notifications in my Google Cloud Console dashboard. It seems that the Blogger api just broke without a warning.

Anybody else have the same experience or can offer help? Thanks!