Log inSign up
Chris Morrell
7,461 posts
user avatar
Chris Morrell
@inxilpro
Come find me on Вӏսеskу — @ cmorrell.com
Philadelphia, PA
cmorrell.com
Joined April 2008
423
Following
2,437
Followers
  • Pinned
    user avatar
    Chris Morrell
    @inxilpro
    Oct 31, 2024
    🦋
    2.8K
  • user avatar
    Chris Morrell
    @inxilpro
    Jul 2, 2023
    Like the idea of UUIDs in #Laravel models, but hate the giant, hyphen-separated strings? I'm about to release a new implementation of Snowflake IDs that give you globally-unique, ordered, numeric IDs. (Same as what Twitter and Discord use.)
    <?php

class User extends Model
{
    use HasSnowflakes;
}

<?php

$user = User::create();

$user->id; // 65964362933587969
    49K
  • user avatar
    Chris Morrell
    @inxilpro
    Jan 31, 2022
    There's so much more that I want to eventually open-source, too. Like check out this beautiful date-picker…
    Image
    00:00
  • user avatar
    Chris Morrell
    @inxilpro
    Dec 13, 2022
    Oooh. Just hit a UUID collision.
  • user avatar
    Chris Morrell
    @inxilpro
    Dec 16, 2023
    How many times a week do you dump a model in #laravel and then have to scroll down to the attributes and expand them? laravel-dumper brings the model attributes to the top of the dd() output for easier debugging.
    Before and after showing a bunch of useless debug data in a dd() output next to useful dd() output.
    31K
  • user avatar
    Chris Morrell
    @inxilpro
    Jul 26, 2024
    Introducing `glhd/linen` — lightweight spreadsheets for Laravel. We've been using this code internally for a while and I finally decided to break it out into a package. It's dead simple, with minimal configuration and a low memory footprint. Check it out…
    <?php

// Reading files

$sheet = ExcelReader::from('my/sheet.xlsx');

foreach ($sheet as $row) {
    // $row is a Collection of data
}

<?php

// Writing files

$query = User::select(['id', 'name', 'email']);

ExcelWriter::for($query)->write('my/sheet.xlsx')


<?php

// Both CSV and Excel support…

ExcelReader::from(...);
CsvReader::from(...);
ExcelWriter::for(...);
CsvWriter::for(...);

// Or automatic by MIME type/extension…

Linen::read('my/sheet.csv');
Linen::write($data, 'my/sheet.xlsx');
    15K
  • user avatar
    Chris Morrell
    @inxilpro
    Jun 14, 2022
    And here's the current API. The wizard now supports Laravel-style rules for each step! 🔥
    <form x-data="{ name: '', age: 0, coppa: false }">

    <div x-wizard:step.rules="{ age: 'required|numeric|min:1|max:120' }">
        Your Age: <input x-model.number="age" name="age" />
    </div>

    <div x-wizard:if="age < 13" x-wizard:step="coppa === true">
        <input type="checkbox" x-model="coppa" name="coppa" />
        I have my parent's consent to register
    </div>

    <div x-wizard:step.rules="{ name: 'required' }">
        Your Name: <input x-model="name" name="name" />
    </div>

    <button x-show="$wizard.isNotLast()" @click="$wizard.next()" :disabled="$wizard.cannotGoForward()">
        Next
    </button>

    <button x-show="$wizard.isLast()" :disabled="$wizard.isNotComplete()" type="submit">
        Submit
    </button>

</div>
  • user avatar
    Chris Morrell
    @inxilpro
    Jan 19, 2022
    Alright. I just tagged the first stable pre-release of Laravel Dumper: github.com/glhd/laravel-d… Just `composer require` and instantly get improved `dd()` and `dump()` output for most Laravel core classes (like Models, Query Builders, the Service Container, etc).
    Image
    00:00
  • user avatar
    Chris Morrell
    @inxilpro
    Apr 24, 2023
    One of these days I'm going to get around to the 1.0 release of this universal address input component…
    Image
    00:00
    17K
  • user avatar
    Chris Morrell
    @inxilpro
    Sep 15, 2022
    Hoping to launch the 0.1 release of Dawn by early next week!
    Coming Soon! Dawn: A new Experimental Browser-testing Package For Laravel.

<?php

No special dusk test case:

REMOVED: class ExampleTest extends DuskTestCase
ADDED: class ExampleTest extends TextCase
{
Use DB transactions and RefreshDatabase:
REMOVED:  use DatabaseMigrations;
ADDED:  use RefreshDatabase;
ADDED:  use RunsBrowserTests;

  public function test_basic_example()
  {
    $user = User::factory()->create();
    
Write regular Laravel tests… just with a browser:
REMOVED:    $this->browse(function($browser) use ($user) {
REMOVED:      $browser->loginAs($user)
ADDED:    $this->actingAs($user)
ADDED:        ->openBrowser()
        ->visit('/home')
        ->press('Dashboard')
        ->assertSee($user->name);
REMOVED:    });
  }
}
 It's fast, too! Our early benchmarks are 50-60% faster!
  • user avatar
    Chris Morrell
    @inxilpro
    Jan 28, 2022
    I find that 90% of the the time, the @laravelphp commands that I write follow the exact same pattern: - Query some data - Perform some operation on each row Internally, we have a trait that simplifies this immensely. I'm working on open-sourcing it right now.
    class ProcessUnverifiedUsersCommand extends Command
{
  // Add one trait to your command
  use ConveyorBelt\IteratesIdQuery;
  
  // Set up a query for the data you'll be operating on
  public function query()
  {
    return User::query()
      ->whereNull('email_verified_at')
      ->orderBy('id');
  }
  
  // Add a function to handle each record
  public function handleRow(User $user)
  {
    $this->progressMessage("{$user->name} <{$user->email}>");
    
    $days = $user->created_at->diffInDays(now());
    
    if (1 === $days) {
      $this->progressSubmessage('Sending reminder');
      Mail::send(new EmailVerificationReminderMail($user));
    }
    
    if ($days >= 7) {
      $this->progressSubmessage('Queuing to be pruned');
      PruneUnverifiedUserJob::dispatch($user);
    }
  }
}
  • user avatar
    Chris Morrell
    @inxilpro
    Mar 4, 2024
    Imagine a world where you could use `x-rules` in @Alpine_JS with @laravelphp-style validation rules and get browser-native errors… 👨‍🍳
    Image
    00:00
    11K
  • user avatar
    Chris Morrell
    @inxilpro
    Feb 8, 2022
    I'm so excited about the release of #Laravel 9. A bunch of folks have outlined the major highlights of this release, so I want to take a second to talk about the few contributions I've made and why I'm excited about them! 👇
  • user avatar
    Chris Morrell
    @inxilpro
    May 7, 2024
    The fact that I can create such a flexible custom @Alpine_JS directive in ~10 mins is just incredible.
    <span
x-typed.speed.100.delay.750="['hello', 'world']"
>
    25K

New to X?

Sign up now to get your own personalized timeline!

Create account

By signing up, you agree to the Terms of Service and Privacy Policy, including Cookie Use.

Terms·Privacy·Cookies·Accessibility·Ads Info·© 2026 X Corp.
Don't miss what's happening
People on X are the first to know.
Log inSign up