๐ฅ Introducing Inertia Table ๐ฅ
Very happy to announce the release of Inertia Table! I have been sweating the details on this one, and I am super stoked to have it out.
I'll show you how much time you can save, all while impressing your users with beautiful, powerful tables ๐คฉ
Hey
@laravelphp
developers, I've got something to show you! Let me introduce you: Laravel Splade ๐ฅ
The magic of Inertia.js with the simplicity of Blade.
Splade provides a super easy way to build Single Page Applications using Blade templates, and that's just one part ๐ฒ
In the
#Laravel
4.x days, I made a prototype for a company that eventually evolved into a massive app with hundreds of classes and tons of functionality.
Today it runs on Laravel 10 and
#PHP
8.2. We always upgraded to the next Laravel and PHP release.
The secret? Keep it
๐ก Advanced
@laravelphp
tip!
If you're using the $attributes variable in a Blade Component, you're using the ComponentAttributeBag class, which is macroable ๐
I wrote a macro to dynamically toggle classes by accepting an array, just like v-bind:class in Vue.js!
#Laravel
#PHP
The latest
@laravelphp
release comes with whereAll, orWhereAll, whereAny, and orWhereAny methods on the DB query builder.
We've all been here, and this is such a nice little cleanup! ๐งน
Lately, I've been working on guidelines for
@laravelphp
applications. Not necessarily coding standards (naming conventions, avoid else, etc.), but more like 'app'-guidelines - things you don't want to forget.
Does anyone have similar guidelines or tips? ๐ง
#laravel
#php
#webdev
๐ก A little
#Laravel
tip from the latest blog post to get the week started!
Under the hood, the withAvg/withCount/withSum and other methods in Eloquent use the 'withAggregate' method. You can use this method to add a subselect based on a relationship ๐ซ
#PHP
#webdev
#OpenSource
Good morning
@laravelphp
developers! It's finally time to introduce the next chapter of Splade ๐ฅ
Say hello to Splade Core! This package will be the foundation of all future Splade packages. In one sentence:
You may now use Vue 3's Composition API in your Laravel Blade views ๐
As of
@laravelphp
v8.77, accessors and mutators are improved and work great with value objects.
When storing a Price as two DB columns (currency and value), you may now directly change the value object, and the changes will automatically sync back to the model ๐ซ
#laravel
#php
๐ก By default, the
@laravelphp
HTTP client doesn't throw exceptions on client and server errors.
However, you can make it do that by using the 'throw' method, and this method is chainable ๐ฅ
Documentation:
#Laravel
#PHP
#webdev
#webdevelopment
Today I refactored a
@laravelphp
Eloquent Query with a 'whereHas' constraint to a 'whereIn' constraint. With the proper indexes (on the comments table) and using a large dataset, I got a massive speed bump ๐จ
I'll investigate further and blog about it ๐ง
#Laravel
#PHP
#webdev
I'm not exaggerating;
@laravelphp
is going to be freaking huge in the coming years. If you haven't jumped on the
#Laravel
train yet, now is absolutely the time. I jumped on 10 years ago and haven't looked back ๐ฅ
Want to see something cool? Splade now supports the View Transitions API. Remember, you're looking at a SPA built with
@laravelphp
Blade templates ๐คฏ
Available in the latest
#Laravel
release ๐
Contributions by
@Johan87
,
@bdsumon4u
, and Yunglin Chu ๐
๐ก Did you know you can specify dependencies in the 'run' method of your
@laravelphp
seeders?
Now I can use the CourseSeeder to create Course models for random teams, as well as for my own team using the 'callWith' method. Quite convenient! ๐
#Laravel
#PHP
#webdev
#opensource
๐ก Maybe everybody already knows since it's been around for ages, but today I needed to set a default URL parameter for some routes, and of course,
@laravelphp
has built-in support!
๐ Docs:
#Laravel
#PHP
Last year when working on e-commerce, I created a Form Components package for
@vuejs
+
@tailwindcss
.
I never told the whole story, but over the last months, I upgraded it to Vue 3. It now also handles the 'processing' state of the
@inertiajs
Form Helper โ๏ธ
More soon!
๐ The
#Laravel
Cross Eloquent Search package can now order the results by model type!
Last week the package was featured on
@laravelnews
:
And
@PovilasKorop
did a quick review of it:
Happy searching!
I'm happy to announce our next Laravel project:
Launcher ๐
We've built a Docker-based deployment tool to launch apps and sites fully containerized.
There is a lot to tell about, so let me walk you through the features and some background info ๐
๐ก You probably know the
@laravelphp
Collections class and its 'map' method and that it accepts a callback.
But did you know you can also pass a variable to specify the callback? Under the hood, it uses PHP's native array_map method.
#Laravel
#PHP
#OpenSource
#webdev
In the next blog posts, I'll cover Database and Eloquent improvements and new features in
#Laravel
8.x.
Here's a great little feature that got added in v8.60 ๐ฅ
PR:
Yesterday's post about Collections:
#PHP
#webdev
#opensource
Introducing Retailer! ๐๏ธ
A
@laravelphp
platform designed to make ecommerce development a breeze. Offering full customization and starter kits for Inertia and Livewire.
Stay tuned. Link and newsletter sign-up in the next tweet! โฌ๏ธ
I'm still working on the
#Laravel
#FFMpeg
demo repo, and it'll include some crazy stuff like playing encrypted HLS streams from a private S3 bucket ๐
It'll also contain Video.js + demos, thumbnails (+ VTT), watermarks, and best practices for queued jobs.
There are so many superb
#Laravel
and
#PHP
packages. Installing them for just everything, notably 3rd-party services, is tempting.
If you need just a few calls, consider using your own implementation. It ensures independence from maintainers, and you get just what you need ๐
Finalizing the wizard that'll get you started on the Video Platform ๐ฅ
I've updated the default photo uploader from the
@laravelphp
Jetstream starter kit to upload directly to S3 from the browser. Luckily I'm using
@inertiajs
๐ช
I'll blog about it soon!
#laravel
#webdev
[1/8] Love using
#Laravel
Dusk for extensive E2E testing! The 'Laravel Dusk Fakes' package enhances the testing capabilities with queued jobs, mails, and notifications. Here's an example from ๐
๐ฆ Package:
#PHP
#opensource
I'm building a portal where users must upload big files (500MB+). I don't want to increase the PHP limits, so what can I do? I don't want to use third-party storage services.
I was thinking about multi-part uploads with a self-hosted
@Minio
server. Any other ideas? ๐ก
#PHP
Who uses the Laravel Data package (by
@spatie_be
) instead of regular Laravel Form Requests to validate incoming requests into a controller?
Really nice to strictly type all data coming in there ๐
Here is V2 of
@inertiajs
Tables for
@laravelphp
Query Builder ๐
It has new features, better UI, bug fixes, and best of all: auto-fill. It auto-generates the header, body, filters, toggles, pagination, and search.
<Table :resource="users" />
#Laravel
I'm working on a new
@laravelphp
package that I've wanted to build for a long time.
It's called Laravel Content. It might end up in practically every new Laravel app of mine. Still working on it, but here's a sneak peek! ๐๐
#Laravel
#PHP
#webdevelopment
Queued jobs in
#Laravel
are perfect for handling time-consuming tasks without making users wait in the browser.
However, it's important to keep users informed about the job's status, whether it succeeds or fails! ๐
#PHP
#webdev
๐ Docs:
๐ก As of
@laravelphp
v8.59, there is a shortcut to find models that are morphed to another model. It's easier to read and prevents hard-coding the polymorphic columns (*_id and *_type).
PR:
Blog post:
#Laravel
#PHP
#OpenSource
Do you know the .vscode/tasks.json file? You can add it to your project, and
@code
will run your configured commands automatically when you open the project โจ
I use this for the Inertia Table so it starts the web server and Vite without me having to open terminals for them ๐
Here it is! No additional dependencies and built right into
@laravelphp
Splade: A Table component doing all the work for you ๐ซ
I'll record a video to show you the magic! ๐ฅ
๐พ Repo:
๐ Docs:
#Laravel
#PHP
#opensource
Did you know
@laravelphp
has a 'Filesystem' class with all kinds of neat methods? ๐
Unlike Storage::disk(), where you can configure multiple disks, this class focuses on the local filesystem. Check out the API:
#Laravel
#PHP
#webdevelopment
#opensource
A
@laravelphp
app from one of our clients has 50+ Notification classes, almost all through the mail and database channels. They wanted to know how effective these notifications are, so we needed some kind of tracking system.
Turns out this is quite simple as each notification
๐ Last week I wrote about the new Collection features in the weekly
@laravelphp
8.x releases. This week: Database and Eloquent ORM!
Since v8.27, you can call `chunkMap` on the Query Builder ๐ก
Blog post:
#Laravel
#PHP
#webdevelopment
#OpenSource
I tagged a new version of
#Laravel
Cross Eloquent Search, which now supports ordering results by relevance ๐
It counts the words/terms in the fields and orders the results by the number of occurrences.
#PHP
#MySQL
#webdev
#Opensource
Hey everybody! Here's my Cyber Week deal! ๐ซ
Laravel Splade v1.0
โ SPA with Blade templating engine
โ Still the full power of Vue.js
โ Sticks close to the default
@laravelphp
features and development flow
โ Automatic installer + Laravel Breeze starter kit
#Laravel
#PHP
๐ I've tagged a new major release of Laravel Cross Eloquent Search!
It now supports disabling wildcards, and the "sounds like" operator that
@marcelpociot
mentioned. Earlier we've included addMany(), addWhen(), count() and simplePaginate() methods.
Just one day until the launch of Inertia Table! ๐
The tests have 100% code coverage. 152 tests running in less than a second! There is a
@laravelphp
Dusk test suite to cover all features on the front-end as well ๐ฅ
Laravel Cross Eloquent Search now supports Full-Text search, even through relationships! ๐คฉ
It's really fast and efficient because all magic happens in-database (pagination, sorting, searching, etc.) ๐จ
Repo:
#Laravel
#PHP
#MySQL
#webdev
#opensource
Eloquent wizards, I have a question for you! ๐ช
I need to find all users that match an exact set of tags. Using a WHERE IN matches just one of the tags.
The example below works, but is there a better way to do this? ๐ค
Full-text search is coming to
#Laravel
Cross Eloquent Search ๐
It supports in-database pagination and sorting, constraints and scopes, and eager loading of relationships.
Only need to work on full-text through nested relationships! โจ
#PHP
#opensource
The next version of Laravel FFMpeg can generate a tile/mosaic from a video ๐ผ
This will allow video players to show tooltip thumbnails. I need to finish the WebVTT implementation and then tag a new version!
#Laravel
#PHP
#opensource
#ffmpeg
Inertia Table is super customizable and flexible in three major ways: styling, templates/slots, and reusing all built-in features with a custom Vue component.
Here's the built-in Table component, but with a custom grid template ๐ฅ
Ever wanted to *append* query data to the current URL? There's a method for that in
@laravelphp
! ๐ช
Will soon submit a PR to the docs :)
#Laravel
#PHP
#webdev
Sort and search through nested relationships, with infinite depth. No additional packages, Model traits, or custom SQL code required ๐คฏ
Coming to is a few days โค๏ธ
#Laravel
#PHP
#webdev
#opensource
Testing Notifications with
@laravelphp
Dusk ๐ซ
It usually doesn't work with Dusk as the test and browser session are different app instances. The NotificationFake saves the sent messages in memory.
I'm working on a similar solution for Jobs and Mails ๐
#Laravel
#PHP
#webdev
๐ก In
@laravelphp
, you can also use the dd() method on the Query Builder. It will dump the SQL query and bindings. Really convenient if you're debugging your database queries!
#Laravel
#PHP
#webdevelopment
Pretty happy with the progress on the Course editor. Reorder videos within a section, move videos between sections, and reorder whole sections ๐
Of course, powered by
@inertiajs
๐ฅ
#buildinpublic
Exciting news! I'm thrilled to announce the launch of the Splade demo app. It's been in beta for a month, but now it's available to everyone. It's a full-featured app, so it deserves its own name. Say hello to Eddy! ๐
#Laravel
#Splade
#PHP
This is my 3rd open-source Tables package (Inertia > Splade > Inertia). Thanks to named arguments, it's the cleanest and most flexible yet ๐ซ
It has some of the most requested features from the others, like Date filters and selectable clauses (contains, starts with, etc.) ๐
Since then, Iย introducedย Retailer. I've come full circle during its development and brought some Splade magic to Inertia ๐ฅ
In the upcoming months,ย I will release a handful of new Inertia packages, with Inertia Table leading the way in the next few weeks ๐
Ever wished you could use Model Scopes when validating the existence of a record? ๐
Rule::exists() lets you pass a Model, but only for extracting the table and connection; you can't use your scopes.
I submitted a PR for a Rule::modelExists() that lets you do that! ๐
๐ Here's part 2 of the new Database and Eloquent ORM features in
@laravelphp
8.x since the release in September 2020.
One of my favorites is the ability in Model Factories to create models without dispatching any events ๐ฅ
Blog post:
#Laravel
#PHP
Happy
@laravelphp
11 day! ๐ฅ
Most of my packages are ready:
โ Blade On Demand
โ Browser Kit Macro
โ Cross Eloquent Search
โ Eloquent Scope as Select
โ FFMpeg
โ MinIO Testing Tools
โ Mixins
โ Paddle
โ Task Runner
โ Verify New Email
These three are waiting for
๐ I'm happy to announce that at the end of 2021, I've become a maintainer of the PHP-FFmpeg repo, which powers the
#Laravel
package.
Today I've opened a massive PR aiming to modernize the library (PHP 8.0+ and Symfony 5.4+):
#PHP
#opensource
#ffmpeg
Laravel Validation tip ๐ก
There's a *distinct* rule that validates that a specific field in each element is unique.
Here's a link to the
@laravelphp
docs. It has some additional options as well:
#PHP
#Laravel
With
@laravelphp
, you can dispatch a Closure job to the queue.
Starting from Laravel 8, may your queued Closure job fail, there's a catch() method you can use to handle the failure ๐งโโ๏ธ
#Laravel
#PHP
#laravel8
It's been 1.5 years or something since I started using Inertia.js, and I can't see myself building apps without it anymore. So when I return from paternity leave, I'll start an open-source
@laravelphp
+
@inertiajs
project. It's not a package but a complete app ๐
#Laravel
#PHP
Announcing FrankenPHP support in Laravel Octane! ๐
FrankenPHP is a modern PHP application server that supports early hints, automatic SSL certificate management, and more. And, when paired with Octane, it's really, really fast. ๐
Enjoy! ๐ซก
The 'Remember me' feature in
@laravelphp
uses a cookie with a token to keep the user authenticated when the session expires.
It works cross-device until you log out on one of them, as it will then refresh the token (server-side)...
...unless you use 'logoutCurrentDevice' ๐
Here's the next
@laravelphp
Splade version. The final one before v1, and it's full of magical but super-easy-to-use features ๐คฉ
โ Lazy Loading
โ Persistent Layout
โ Transitions
โ Teleports
๐ Docs (and Breeze kit) are updated:
#Laravel
#PHP
#webdev
The next version of
@laravelphp
Splade comes with a Table component. It has every feature of the Inertia equivalent and is really snappy ๐
Of course, it's also compatible with
@spatie_be
's Query Builder. I'm currently writing docs and some additional tests โ๏ธ
#Laravel
#PHP
Just in time for the new year, here's a new version of
#Laravel
FFmpeg! ๐
๐ Create a mosaic/sprite/tile
๐ Much better support for exporting frames
๐ VTT Preview Thumbnail generator
Have a great time everybody, and take care! โค๏ธ
#FFMpeg
#PHP
#webdev
๐ก You probably know the
@laravelphp
Collections class and its 'map' method and that it accepts a callback.
But did you know you can also pass a variable to specify the callback? Under the hood, it uses PHP's native array_map method.
#Laravel
#PHP
#OpenSource
#webdev