Next up, we have @taylorotwell on @LaraconOnline

Thread about keynotes from Taylor's talk.

๐Ÿงต
Thanking everyone ๐Ÿ˜…
Stupid internet got disconnected. Alright, we are back on.
Exploring Laravel Sail

sail up to start Laravel Sail using #Docker

All you need to do is go to localhost to use Sail app.

oh we are actually exploring @meilisearch
5000 movie records.

sail artisan scout:flush "App\Models\Movie"

sail artisan migrate:fresh --seed

Seeder was inserting into Meiliesearch that's why it will take few minutes.

( meliesearch using Laravel Scout )
Oh Taylor is using Apple Safari, cool.
Search for the record. Really quick.

Meliesearch for searching Eloquent Models. It's pretty cool. Recommended by Taylor.
Some improvements of Laravel Breeze.

Feather weight authetnication scaffolding for Laravel. All of the logic exported directed to Laravel app.

Also great for people who are learning Laravel , like beginners.

Now it has @inertiajs version

Laravel Breeze with Inertia
--inertia flag for Laravel Breeze. NPM install and dev.

Showing the Controllers and telling how we can modify them to our needs.
@inertiajs based Laravel Breeze, also talked about Hot reload in Laravel Mix.
Next is Cashier updates.

@driesvints and one other contributor worked on Metered Billing in Laravel Cashier and it has now landed.

Imagine you are building Email service where customer pay different amount per different quota. Plan is dynamic. Depends on usage ->Metered Biling
Two new casts available in Eloquent ORM.

AsArrayObject and ...

'array' and 'json' casts are not going anywhere but these have limitations.

Eloquent model attributes are magically resolved. Set the virtual property which doesn't exist.
We need to update the whole attribute to avoid the above error.
ArrayObject is a PHP class, natively, that's why we use AsArrayObject and not ArrayObject, but it does extend it under the hood.

Json extension in Safari, good to know.

iterable can cover AsArrayObject in type-hinting of methods.

you can also get ArrayObject as collections.
Two new Casts for Eloquent

AsCollection and AsArrayObject

Both of these casts make it easier to work with arrays coming out of database.
Fluent way to make assertions against JSON, by @ClaudioDekker

AssertableJson -> Fluent Assertions on JSON data ๐Ÿฅณ

whereAll() shortcut to avoid many where methods.

missingAll() method will warn if new field is present which we didn't specify.

etc() method to resuce ๐Ÿ˜
etc() method deserves a separate tweet

Great work, @ClaudioDekker
Fluent JSON testing also allows us to work with meta.

->has() methods

->has('users', 2 ) // specify we get 2 users
Parallel Testing , addition by @enunomaduro in Laravel 8

Synchronous tests = Slow

php artisan test --parallel ๐Ÿ˜
NEW Middleware for throttling Job Exceptions.

How many exceptions will your job throw per minute / per 10 minutes or whatever.

decayMinutes: 0.24, 10 exceptions per 15 minutes

only throttle when() its instance of RuntimeException
$maxExceptions = 3, if exception is not expected only handle it 3 times and then fail it.

This new middleware is also available in Laravel 8.
Laravel Octane ๐Ÿ˜

Logo by @Caneco

#Laravel #PHP @LaraconOnline
It's always fun to make things faster.

Developers Love Speed ๐Ÿ˜‚

Run Laravel faster, Run Laravel at extreme speeds.
Typically we run PHP behind web servers like Nginx. And whole code is booted at every request. And it's all good.

No worries about memory leak etc.

downside is, every aspect of Laravel framework has to be booted again on *every request*.
Framework overhead that we need to do all this on every request. 100 of millions of requests can be handled per month with Laravel.
Boot framework and keep it memory to avoid all this.

There are tools already available like @php_swoole , RoadRunner. But it doesn't offer co-routines like Swoole. Swoole does require us to install extension in order to use it.
Some gotchas to run your PHP like this.

Config changes, static properties on classes will leak into next incoming requests.

But we also run our Laravel apps like this, but in Queues, in background. We are not scared of it. We have memory leaks in Queue workers.
So we can use the same thing in Web layer, possibly using Laravel Octane.

Laravel will introduce first-party package thing to support running on Swoole or RoadRunner etc
Offer a single unified package to run Larvael on things like @php_swoole and RoadRunner.

This is what Laravel Octane is about.

#Laravel #php
config/octane.php

Lots of events, RequestRecieved, RequestHandled, RequestTerminated etc
HOw to use Octane

workers depends on CPU

Woooahhh... its supppper fast โšก๏ธ Can't capture speed on screenshot.

You will just have to believe me. Super fast!๐Ÿ˜‚
If you make a change, it will not appear.

Queue worker mindset. If we make change, we have to reload our Swoole server.

It's inconveniet, right?
Well, @taylorotwell introduced Hot-Reloading which works for both @php_swoole and Road Runner to solve it.
What about performance?

400 requests per second with PHP-FPM and Nginx

Same test for Swoole version 6281 requests/second ๐Ÿคฏ

Woah.. That's a lot of performance boot using @php_swoole with Laravel Octane.

#Laravel #PHP
Laravel Octane will be released soon :)
Octane::route(), a route or two which you need to be blazing fast!

Don't build all app routes on Octane routes ๐Ÿ˜‚

Must respond with Illuminate\Response.
OH MY GOD....

16K+ requests/second on Octane Routes.

So much more to do with Octane. Beta is coming in few weeks and will be available.
End of @taylorotwell talk.

Man, that was insane! Mind blowing.

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Zubair Mohsin

Zubair Mohsin Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Zubairmohsin33

17 Mar
Next up we have @enunomaduro on @LaraconOnline

He'll be telling us about Artisan Console Component

Thread ๐Ÿงต
Image
Few projects of Nuno running on Artisan console component. ImageImage
Read 19 tweets
17 Mar
Next up we have @calebporzio talking about @LaravelLivewire and @Alpine_JS

Thread ๐Ÿงต Image
of Livewire. Woah! ImageImageImage
Show the small things, instead of big things.

Shoutout to @TransistorFM and @noplanstomerge Image
Read 26 tweets
17 Mar
Next up we have @m1guelpf on @LaraconOnline

He'll be talking about Laraveil Illuminate Foundation

Thread ๐Ÿงต
laravel/framework requires micro packages namespaced under Illuminate.
Read 17 tweets
17 Mar
Next up we have @marcelpociot

He'll be talking about Laravel Broadcasting on @LaraconOnline

Thread ๐Ÿงต
Follow along at laracon.beyondco.de

It contains some interactive examples.
Two components involved in Broadcasting. Just the communication between Laravel Backend

Everytime you shoot the shoot button confetti's happen in real-time. ( laracon.beyondco.de )
Read 25 tweets
17 Mar
Next up we have @bobbybouwmann who will be talking about Laravel Router.

Thread ๐Ÿงต
And now he's updating Zoom in the background ๐Ÿ˜‚
That's a good menu
Read 33 tweets
17 Mar
Next up is @christophrumpel talking about Service Container.

Thread ๐Ÿงต
Cool animation on slides.
Dinner break ๐Ÿ˜” can't live-tweet ... Just listening ๐Ÿ˜…
Read 21 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!