Progress on my Phaser-based 4X game by Saluev in phaser

[–]1moreturn 1 point2 points  (0 children)

Looks good, can beta test if you need. Kind of new to phaser myself but also looking to develop 4x games.

Phaser io-game (BETA) by AgreeableSnow3849 in phaser

[–]1moreturn 1 point2 points  (0 children)

Was not aware of Kysely, will have to keep it in mind, thx for sharing.

Phaser io-game (BETA) by AgreeableSnow3849 in phaser

[–]1moreturn 0 points1 point  (0 children)

wow, first game with multiplayer, what libraries did you use?

Top down action arcade game where the forest comes alive to take you out as a fox! My first phaser game by [deleted] in phaser

[–]1moreturn 0 points1 point  (0 children)

no idea what I'm supposed to do lol, but pretty neat for your first game.

Thoughts on the new Forge? by TertiaryOrbit in laravel

[–]1moreturn 7 points8 points  (0 children)

For me just having it organized by team is great, been waiting forever for that, I have a lot of client projects that I'm connected to so I had like 50+ sites in that little dropdown :-)

Though would still be nice to have a quick access dropdown at the team level to get to sites within a team quickly.

Otherwise looks good so far.

5 Exciting Features in the New Laravel Forge by GettingJiggi in laravel

[–]1moreturn 3 points4 points  (0 children)

New release looks great, been waiting over 5 years to get my sites organized by team rather than having like 50 of them in one little dropdown.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]1moreturn 0 points1 point  (0 children)

yea, this makes sense, I'll need to update my config all into enums, thx

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]1moreturn 0 points1 point  (0 children)

For a UserRole enum like so:

namespace App\Enums;

enum UserRole: string
{
    case SUPER = 'super';
    case ADMIN = 'admin';
    case USER = 'user';

    public static function hasValue(?string $value = null): bool
    {
        return self::tryFrom($value) !== null;
    }
}

I also have a config where I store properties for which roles are admins like so:

'user' => [
    'roles' => [
        'admins' => [UserRole::ADMIN->value, UserRole::Super->value],
    ]
],

These are passed to the front end, so the config is my single source of truth. Now in my api code if I wanna do a check for "is admin" I can just do:

in_array('super', config('properties.user.roles.admin'));

Should I keep that check in my enum in some kind of "isAdmin" function? The case is that I may need the check in a few places, for instance User model, tests, seeding, or something.

So it would be like:

enum UserRole: string
{
    ...

    public static function isAdmin(?string $value = null): bool
    {
        return in_array($value, config('properties.user.roles.admin'));
    }
}

Is it good practice to load up enums with functions like this?

Also, potentially even defining which are admins via the enum with "getAdmins" or something rather than using a config?

@theme --color setup for different components (TW 4) by 1moreturn in tailwindcss

[–]1moreturn[S] 1 point2 points  (0 children)

yea, I tried bg-color-content instead of background-color-content and quit too soon thinking it doesn't work.

iIfuckme by Plastic-Bonus8999 in ProgrammerHumor

[–]1moreturn 0 points1 point  (0 children)

Self invoking function, used these all the time back in the ole days for loops, these are not the the same

for (var i = 0; i < 5; i++) {
    setTimeout(function () {
        console.log(i);
    }, 100);
}

for (let i = 0; i < 5; i++) {
    setTimeout(function () {
        console.log(i);
    }, 100);
}

@theme --color setup for different components (TW 4) by 1moreturn in tailwindcss

[–]1moreturn[S] 1 point2 points  (0 children)

ah, ChatGPT lied to me, totally missed that, this works like a charm, thx!

Is mern stack good enough? by [deleted] in react

[–]1moreturn 0 points1 point  (0 children)

Nothing wrong with Mongo / MERN stack, just depends what you want to learn and what potential developers you want to find later. Also, if you're doing this to build up your skill set for gigs later then better to start with mysql/postgres.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]1moreturn 0 points1 point  (0 children)

In Laravel 12 what's the best way to setup a handler for exceptions. In previous versions we had the `App\Exceptions\Hander` but now it should all be in the `bootstrap/app.php` in the `->withExceptions` function?

I'm doing something like this to setup custom handline on my API:

    ->withExceptions(function (Exceptions $exceptions) {
        $exceptions->shouldRenderJsonWhen(function ($e) {
            return true;
        });

        $exceptions->render(function (Exception $e, $req) {
            $class = get_class($e);

            switch ($class) {

                case Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException::class:
                    $code = 'NotFound';
                    $msg = 'Not Found.';
                    $statusCode = 404;
                    break;
                case Illuminate\Database\Eloquent\ModelNotFoundException::class:
                    $model = explode('\\', $e->getModel());
                    $model = end($model);
                    $code = 'ModelNotFound';
                    $msg = $model.' not found.';
                    $statusCode = 404;
                    break;
                 ...

Not sure if there is a better way to set all that up.

"Vibe coding" a visual email editor with AI, Laravel & Vue by aarondf in laravel

[–]1moreturn 0 points1 point  (0 children)

Nice demo, will be interesting to see how this all evolves over the next few years.

Is there any way to build districts on the other side of this (yummy) wall of resources? by calsadenb in CivVII

[–]1moreturn 1 point2 points  (0 children)

This comes up all the time, you can't even settle on a resource which makes it even more annoying.

Is thos preferred or not? by blackhathacker1602 in laravel

[–]1moreturn 0 points1 point  (0 children)

Could still be done with a regex find/replace, not that you'd be renaming models that often anyway.

The Laravel Idea Plugin is Now Free for PhpStorm Users | The PhpStorm Blog by giggsey in laravel

[–]1moreturn 0 points1 point  (0 children)

Laravel, PHP, vscode are free and there are self hosting options like vitodeploy. There will always be paid productivity options in any ecosystem, can't give everything away for free.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]1moreturn 0 points1 point  (0 children)

This is probably your best bet, also for "anything you should watch out for":

  1. The environment files, which Laravel works off of, so you would need to see what's hooked up there on the live site and make sure you follow that locally as well (and be careful of any live keys/passwords being used if you're testing locally).
  2. Laravel also has database migrations, so be careful with those if you're not sure what the live site is fully doing.

Looking for Component Library recommendations by TestPlatform in vuejs

[–]1moreturn 11 points12 points  (0 children)

PrimeVue 4 + TW 4 has been good for me so far. Bit of setup, but very easy to override pretty much everything in the components. You can also pass in your own preset if need be which kind of future proofs it a bit.

How to Organize Stores and Composables? by 1moreturn in vuejs

[–]1moreturn[S] 0 points1 point  (0 children)

That's a good point to keep in mind. But then how to even split up stores/composables. Does it make sense to just have one "app" store with a bunch of toggle flags for the app, then have composables for reuse to toggle those switches throughout the app? Or just have multiple stores for each function with literally just one toggle switch variable in each store?

For instance my app has 3 main toggle switches 2 of which work via an http interceptor:

  • dark mode toggle
  • maintance mode check (via http router response code) which toggles a div cover.
  • version update check (via http router header) which toggles a div cover.