thesimons's avatar

thesimons started a new conversation+100 XP

4mos ago

Hello,

I'm dev mode locally using Herd Pro. I'm working with a pretty heavy panel powered by Filament 4.

I have tweaked the tweak-able things. I have max exec time at 300 seconds. But it keeps going timeout.

Any idea how to avoid it? I have hard this issue before but the solution was for Windows.

Thanks, Simom

thesimons's avatar

thesimons wrote a reply+100 XP

4mos ago

That's a good point! However this is the logic for panel into the "private area".

Many errors would "redundant". In example if new_password is missing, I just need to have an error saying "password missing". I don't need "password missing" and "passwords don't match".

thesimons's avatar

thesimons wrote a reply+100 XP

4mos ago

I have redacted the guard with a generic "foo" for privacy.

thesimons's avatar

thesimons started a new conversation+100 XP

4mos ago

Hello,

don't kill me please. I tried the Laravel "validation" style but I'm unable to get the same result for the following (dirty) code.

Basically I want to flash one error at time. Could you please suggest a cleaner approach?

Thanks Simon

thesimons's avatar

thesimons started a new conversation+100 XP

5mos ago

Hello,

is there any migration command in order to refresh / reset a single table not the entire database?

During development I prefer to refactor migrations instead of adding new migration to add/delete/edit previous migrations.

Thanks, Simon

thesimons's avatar

thesimons wrote a reply+100 XP

5mos ago

I have never said that 8.5 has something wrong.

thesimons's avatar

thesimons started a new conversation+100 XP

5mos ago

Hello,

Yesterday - while deploying a new server - I have the funny idea to install PHP8.5 just released.

As result for that I got a list of errors. I think it'd be better to give it few weeks before thinking about deploying in production.

Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - brianium/paratest[v7.8.3, ..., v7.8.4] require php ~8.2.0 || ~8.3.0 || ~8.4.0 -> your php version (8.5.0) does not satisfy that requirement.
    - brianium/paratest[v7.9.0, ..., v7.11.2] require php ~8.3.0 || ~8.4.0 -> your php version (8.5.0) does not satisfy that requirement.
    - pestphp/pest v3.8.2 requires brianium/paratest ^7.8.3 -> satisfiable by brianium/paratest[v7.8.3, ..., v7.14.2].
    - brianium/paratest v7.14.2 requires phpunit/phpunit ^12.4.1 -> satisfiable by phpunit/phpunit[12.4.1, 12.4.2, 12.4.3, 12.4.4].
    - brianium/paratest v7.14.1 requires phpunit/phpunit ^12.4.0 -> satisfiable by phpunit/phpunit[12.4.0, ..., 12.4.4].
    - brianium/paratest v7.14.0 requires phpunit/phpunit ^12.3.15 -> satisfiable by phpunit/phpunit[12.3.15, ..., 12.4.4].
    - brianium/paratest v7.13.0 requires phpunit/phpunit ^12.3.9 -> satisfiable by phpunit/phpunit[12.3.9, ..., 12.4.4].
    - brianium/paratest v7.12.0 requires phpunit/phpunit ^12.3.6 -> satisfiable by phpunit/phpunit[12.3.6, ..., 12.4.4].
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.4.4.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.14.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.13.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.12.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.11.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.10.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.8.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.7.
    - pestphp/pest v3.8.2 conflicts with phpunit/phpunit 12.3.6.
    - pestphp/pest-plugin-laravel v3.2.0 requires pestphp/pest ^3.8.2 -> satisfiable by pestphp/pest[v3.8.2, v3.8.3, v3.8.4].
    - Conclusion: don't install pestphp/pest v3.8.3 (conflict analysis result)
    - Conclusion: don't install pestphp/pest v3.8.4 (conflict analysis result)
    - Root composer.json requires pestphp/pest-plugin-laravel ^3.2 -> satisfiable by pestphp/pest-plugin-laravel[v3.2.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Thanks, Simon

thesimons's avatar

thesimons started a new conversation+100 XP

5mos ago

Hello,

what's the best way to share a private function among different controllers?

I have an area of my about Working Hours with partners: always, everyday (same hours for every day), custom. I have split the logic in 3 different controllers. However there are 3 private functions to be used in each controller.

What's the best approach to share them?

Thanks, Simon

thesimons's avatar

thesimons wrote a reply+100 XP

5mos ago

I have fixed half of my issue moving from VSCode to PhpStorm.

I tried PhPStorm months ago without success. But this time, frustrated by inconsistency of VSCode I decided to force myself sticking to it.

Good choice. I'm "less lost".

Thanks, Simon

thesimons's avatar

thesimons wrote a reply+100 XP

5mos ago

Fixed. The routes were inside a middleware for authentication. I have simply added ClearSpokenLanguageWizardSession as second middleware.

It's worked out properly.

Thanks, Simon

thesimons's avatar

thesimons started a new conversation+100 XP

5mos ago

Hello,

I have problems with the following middleware.

The aim is whatever HTTP call outside https://my.site.com/profile/settings/spoken-languages/wizard (+ sub sections) would make sessions spoken_language_id and spoken_language_proficiency_id to be forgotten.

<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class ClearSpokenLanguageWizardSession
{
    public function handle(Request $request, Closure $next)
    {
        $response = $next($request);

        // If user navigates away from wizard routes, clear session keys
        if (! $request->is('profile/settings/spoken-languages/wizard*')) {
            session()->forget([
                'spoken_language_id',
                'spoken_language_proficiency_id',
            ]);
        }

        return $response;
    }
}

and it's registered in the following way into bootstrap/app.php

->withMiddleware(function (Middleware $middleware): void {
        $middleware->validateCsrfTokens(except: []);
        $middleware->append(ClearSpokenLanguageWizardSession::class);
    })

Thanks, Simon

thesimons's avatar

thesimons wrote a reply+100 XP

5mos ago

My biggest problem for now is sticking with Laravel's default conventions.

Having coded for 22 years using core PHP and bit "indie" about coding. I really appreciate how things are organised under Laravel.

thesimons's avatar

thesimons wrote a reply+100 XP

5mos ago

Thanks for your terrific answers. I fell better knowing that I'm not alone.

With "big" I mean "large". I have created many other apps in Laravel before. Some of them really "mission critical". I have developed a full payment gateway handling 3DS etc etc. A CMS able to encoding videos and many other smaller things.

This is the first I face a so huge amount of data.

Thanks also for the advices :)

thesimons's avatar

thesimons wrote a reply+100 XP

5mos ago

Yes, I'm doing the same. Today I refactored a controller with over 500 lines of code. Split it in several controllers etc etc.

I will definitely with the videos you mentioned.

Thanks!

thesimons's avatar

thesimons started a new conversation+100 XP

5mos ago

Hey everyone,

This isn’t really a help request — more of a curiosity.

I’m currently working on my first big project with Laravel, and sometimes I feel like I get a bit lost inside my own app — jumping between controllers, structures, and so on.

Is that something everyone goes through at some point, or does it mean I’m doing something wrong in how I’m structuring things?

Thanks, Simon

thesimons's avatar

thesimons wrote a reply+100 XP

6mos ago

Regarding PCI-DSS certification, you don't need it if you tokenize without touching card holder data. You need a very "soft" certification if just submit data via POST to the payment gateway.

Go with a single project.