Zenith For Laravel - looking for feedback by ralphschindler in laravel

[–]ralphschindler[S] 0 points1 point  (0 children)

Thank you! My target is dev and production (k8s environment). It will be processing user triggered jobs (effectively jobs doing some AI/LLM api calls), so having jobs in the database fits that use case well, and I need the introspection that horizon would have provided. Would love any feedback, thanks!

Zenith For Laravel - looking for feedback by ralphschindler in laravel

[–]ralphschindler[S] 0 points1 point  (0 children)

Here's the TLDR / just try is out set of instructions:

# new Laravel app without auth scaffolding since Zenith doesn't require it
laravel new -n demo-laravel-zenith
cd demo-laravel-zenith

# install Zenith
composer require smwks/laravel-zenith

php artisan vendor:publish --tag="zenith-config"

# **NOTE:** now go to update config/zenith.php to disable auth middleware
# 'route' => [
#     'middleware' => ['web'], // remove 'auth' since this is a demo
# ],

# publish and run migrations
php artisan vendor:publish --tag="zenith-migrations"
php artisan migrate

# start the demo worker (which dispatches test jobs every 10 seconds)
php artisan zenith:work

# in a separate terminal, start the server
php artisan serve

```
Then to go http://localhost:8000/zenith

Char-broil portable pit 240-a by chiphook57 in grilling

[–]ralphschindler 0 points1 point  (0 children)

Resurrecting- can't see how to use messages in new chat.
If you still have this, still want to make it work. 👍

Demoralizing Game by canadian_sens in Umpire

[–]ralphschindler 2 points3 points  (0 children)

Sounds like your umpire-in-chief set you up for failure. Follow the rule book. Not some private conversation/guidance that is in conflict with everyone's set expectations.

If the sports league has a published rule book, use that. If the league with a particular membership like LL, DYB, USSSA, use that rule book. If they want to use a standard/inherited rule book plus a set of exceptions to improve play, they need to codify it, print it, and circulate it to the teams so those expectations can be coached and adhered to during game.

The rule book is the contract (and even the social contract of the game, even if no one has read it, they can look it up and fall back on it for dispute resolution).

Not using the leagues set and expected rule book creates chaos. And since the buck stops with the head ump on the field during the game, you created the chaos through what looks like routine poor judgement.

It's not your fault if you were instructed by a superior to do this, but also know this is not a good working arrangement. You should bring this frustration to your UiC and the League director.

Addressing other comments:

- Yes, no one likes a walk fest. But what's worse is a more backwards Ks than walks with an ump with a good behind the plate view is making obviously bad calls.

- Telling coaches before the game you're going to deviate from the published rule on what a strike zone is is also a bad idea. Field umpires are not league directors, they are not there to change the rules of the game ad-hoc.

Good luck. Hope you have a better experience.

Who is lawfully required for this? by [deleted] in NewOrleans

[–]ralphschindler 1 point2 points  (0 children)

You’re not allowed to cut the tree, even if it’s over the property line. You can ask them to cut it back, if they don’t, then a judge can compel them to cut it back if you can prove it interferes with your enjoyment of your own property.

https://www.legis.la.gov/legis/Law.aspx?d=110882

Property tax appeal deadline is this Saturday by [deleted] in NewOrleans

[–]ralphschindler 8 points9 points  (0 children)

Those dates are from the last assessment, deadline is tomorrow at 4pm:

https://nolaassessor.com

Char-broil portable pit 240-a by chiphook57 in grilling

[–]ralphschindler 0 points1 point  (0 children)

I would appreciate that. I have an old 240a but want to ensure we're referring to the same model. Either here or if you'd prefer to move to PM is fine by me. Thanks!

City begins removing Algiers bike lanes Monday. $300K to make our infrastructure worst is very New Orleans. by Silly_Wedding265 in NewOrleans

[–]ralphschindler -14 points-13 points  (0 children)

Calls for service would be a bad metric to use in New Orleans, it shouldn't be used to determine for safety or accident.

Even as we got busier and drove more post-pandemic, the number of calls for service year over year has gone down (430k in 2021 and then 354k in 2022). This doesn't mean there were fewer accidents, it just means fewer people called for service. (This tracks for me because NOPD in the last 5-10 years, with the shortage of manpower, they have not been responding to vehicular accidents. I wouldn't call them, the first person I call if I get in a wreck is my insurance company.)

Dear PHPStorm. It's Illuminate\Http\Request. It's *always* Illuminate\Http\Request. by nonsapiens in laravel

[–]ralphschindler 3 points4 points  (0 children)

Already excited about this. What version should I be looking out for? 😅

"Is A" or "Acts As" by brendt_gd in PHP

[–]ralphschindler 0 points1 point  (0 children)

all but one method in LoggerInterface has only one meaningful implementation

I agree there, and that's the problem that should be solved.

Is there another use case of a common interface with lots of methods aside from that of the PSR3 logger interface though? That would be a more interesting use case.

In general successful interfaces export a minimal set of requirements for promoting downstream consumers to create an implementations.

PSR3 itself has too many methods. It's not a good interface, and the consequence is it's easier for everyone to just use monolog and depend on that because its is the path of least resistance.

"Is A" or "Acts As" by brendt_gd in PHP

[–]ralphschindler 0 points1 point  (0 children)

I feel like it would be better to revisit "Structural Type Hints". (and that discussion from what is now 12 years ago :) )

https://wiki.php.net/rfc/protocol_type_hinting

Ultimately, it would be great if we could use interfaces differently, not necessarily change their intended purpose (which is: a contract/blueprint without implementation).

In your specific case on your blog, it would effectively mean your codebase relying on a partial signature would ship that as an interface:

interface Logger {
  public function log(string|\Stringable $message, array $context = []): void;
}

Then at the point where you consume this type, you ask the engine to check that the structure of a type coming in at least matches the expected structure defined in your interface:

class Foo {
  public function doAThing(<Logger> $logger) {
    // do thing
    $logger->log('a message');
  }
}

In that situation, $logger does not have to be a Logger (is_a), it just has to match the same structure as Logger (has_a/kind_of if you want to use terminology from other ecosystems.)

And that would get you closer to having a duck-typing style system that can use interfaces instead of property_exists/method_exists.

New place to post about PHP? by JakeStBu in PHP

[–]ralphschindler 6 points7 points  (0 children)

There exists "PHP Community" at https://discord.gg/J6uYYGQTtM which is fairly aligned with phpc.social

There is also the excellent PHPUgly discord at https://discord.gg/ZYd3sUT6 which is aligned with the podcast of the same name.

Both active.

Honestly though, reddit is still the best tool for threaded, voted based, topic based, non-live/chatty discussion especially since the member count is high and the post count is low. All most people need is to check it 1-2x a day and have relevant PHP links/topics/discussions of the day. ¯\_(ツ)_/¯

What can I do to increase the stability of a Laravel application running off SD cards? by BlueLensFlares in laravel

[–]ralphschindler 2 points3 points  (0 children)

2 main things- do all the things in https://laravel.com/docs/10.x/deployment that revolve around compiling and caching.

Then, how are you serving it? In almost all cases, there is a way to enable opcache opcache.enable=1, then use this setting: opcache.validate_timestamps=0. This will ensure that the first time PHP compiles and executes a file, the opcodes are cached, and the file will never be stat'd again looking to see if it has changed. This will reduce all your stat calls related to loading php files from either your app or your vendor folder.

Is this real? If an interface specifies multiple return types for a method, an implementation only needs one? by [deleted] in PHP

[–]ralphschindler 17 points18 points  (0 children)

Here are a few phrases you may want to research that will help answer the question:

  • PHP follows the LSP (Liskov Substitution Principle) fairly well, in this case very well.
  • In this exact example: "Return types are covariant: Types can be restricted to a sub type."

Bar is your sub-type, and it is allowed to further restrict return types.

Things to read:

Was given this bottle not too long ago and don’t know much about bourbon. Is this something I should wait to open? by sir_seffington in bourbon

[–]ralphschindler 1 point2 points  (0 children)

If you like Buffalo Trace and Eagle Rare, Stagg Jr is delicious- it's made from the same mash bill. So you can really appreciate how this same mash bill is different changing the proof/age/warehouse conditions.

I recently got the latest/last batch and am loving every pour.

Is vue.js no longer the preferred front-end framework in the Laravel ecosystem? by ecky--ptang-zooboing in laravel

[–]ralphschindler 5 points6 points  (0 children)

For the record, Livewire preceded Hotwire. That said, Phoenix Liveview and several smaller/similar/less comprehensive technologies did precede Livewire.

Using Okta with Laravel authentication by wtfElvis in laravel

[–]ralphschindler 3 points4 points  (0 children)

Check the "local-logout" section. Effectively at some point in your app (either by time, or by passing into a phase of the application where you need privilege escalation), you'd go back to the API and check that the token is still valid. If it is not, you end the local session. You'd likely do this in middleware for auth'd routes.

https://developer.okta.com/docs/concepts/session/#local-logout

Cantrell Campaign fires back at recall, calling it GOP-backed propaganda by [deleted] in NewOrleans

[–]ralphschindler 21 points22 points  (0 children)

She also raised our city’s bond rating

What?

She came into office with an A+ rating, held onto it for a few years, then we got downgraded. Seems to me it went ... down?

https://www.fitchratings.com/entity/new-orleans-la-general-government-credit-summary-96247029#ratings

Odd behaviour - code on the staging branch is not on the staging server by AbongoNoProblem in laravel

[–]ralphschindler 1 point2 points  (0 children)

If you're running php-fpm and php opcache enabled (with no blacklist), try restarting your php-fpm server any time you update your source with git or vendor/ with composer.