Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From the Wild into the Clouds - Laravel Meetup ...

Silvan Hagen
February 25, 2025

From the Wild into the Clouds - Laravel Meetup Talk

Silvan will share his hands-on experience migrating his project, Wire in the Wild, to Laravel Cloud. He will walk us through the challenges and lessons learned while adapting a Livewire powered application to Laravel’s fully managed cloud infrastructure. From deployment strategies to optimizing performance, migrating from MySQL to Postgres DB and from disk to S3 like Object Storage, he’ll reveal key insights that can help developers smoothly transition their own projects to the cloud.

Talk Details: https://silvanhagen.com/talks/meetup-laravel-cloud/

Silvan Hagen

February 25, 2025
Tweet

More Decks by Silvan Hagen

Other Decks in Programming

Transcript

  1. Moving day Set aside enough of your favorite caffeinated drink

    – Called my mom to tell her that I'm not available for tech support – Kiss my wife goodbye for 2 days –
  2. Moving day, for real From MySQL to Postgres 1. From

    disk to Object Storage 2. From local to third-party services 3.
  3. 1. From MySQL to Postgres Check your custom queries –

    Make sure your packages are compatible – Move your database content –
  4. Custom Queries $query = auth()->user()->is_admin ? Project::query()->orderByRaw(DB::getDriverName() === 'mysql' ?

    'FIELD(status, "in review", "published", "archived")' : "CASE WHEN status = 'in review' THEN 1 WHEN status = 'published' THEN 2 WHEN status = 'archived' THEN 3 ELSE 4 END" ) : auth()->user()->projects(); return $query; From MySQL to Postgres 1.
  5. Here is what I missed Postgres currval -- Get last

    value SELECT last_value FROM <table>_id_seq; -- Get sequence information SELECT * FROM <table>_id_seq; -- Get next value without incrementing SELECT nextval('<table>_id_seq'); -- Get current max ID from the table SELECT MAX(id) FROM <table>; -- To fix this SELECT setval('<table>_id_seq', (SELECT MAX(id) FROM <table>))
  6. Here is what I missed If you like like like

    I do... $query->whereLike('name', '%Caleb%') // OR $query->whereRaw('LOWER(name) LIKE ?', [strtolower('%Caleb%')]) // OR $query->whereRaw('name ILIKE ?', '%Caleb%')