PHP Reddit – Telegram
PHP Reddit
33 subscribers
293 photos
37 videos
24.9K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Laravel Lift alternative

Hi


I've discovered Lift :
Lift is a package that boosts your Eloquent Models in Laravel.

It lets you create public properties in Eloquent Models that match your table schema. This makes your models easier to read and work with in any IDE.

It provides a simple way to set up your models, focusing on simplicity and ease of use by using PHP 8’s attributes.

The package depends on Eloquent Events to work. This means the package fits easily into your project without needing any major changes (unless you’ve turned off event triggering).

However, I've tried to implement in on a model, in an existing project, but I did have an issue with a foreign ID, that I never figured to make working.
Two similar unanswered issues in the github repo makes me think this is either unreliable or abandoned.

Do anyone know and use some equivalent package, that allows to define properties and their attributes (fillable, cast, etc...) directly inside the model ?

If you haven't heard about it, have a look at the docs, or the laravel news blog post that describe it :https://laravel-news.com/laravel-lift. I love the idea of this package, but it seems it needs some polishing...

https://redd.it/1iy57gq
@r_php
For those using Laravel with Svelte, what’s your stack/workflow like?

I’ve seen two stacks so far:

- Laravel + Inertia with Svelte. The downside seems to be 1) backend and frontend is coupled together (could be a positive). 2) Can’t use SvelteKit

- Separate SvelteKit app consuming an API powered by Laravel



https://redd.it/1iye1wo
@r_php
A mod that adds saving & reloading to php artisan tinker

I used to use the app https://tinkerwell.app/ until my new company refused to buy it for me! I wanted to recreate the basic work flow of interactive development that tinkerwell provides.

# Without the Mod

Say you are working with a user in tinker:

>$joe = User::where('username', 'joe')->first()
>$joe->fullName
Smith Joe // Oh no! Theres a bug!

Fix the bug:

function getFullNameAttribute() {
return $this->firstname . ' ' . $this->lastname;
}

And tinker is using your old session:

>$joe->fullName
Smith Joe // Oh no! The bug is still there!

In normal Tinker you would have to fix the bug, close the session, reopen the session, and then rerun the query to get $joe again! This makes interactive development difficult and you will find your self Ctrl+C to close, press up to reload previous commands, and repeat.

# With the Mod

>$joe = User::where('username', 'joe')->first()
>$joe->fullName
Smith Joe // Oh no! Theres a bug!

Fix the bug:

function getFullNameAttribute() {
return $this->firstname . ' ' . $this->lastname;
}

Now back to tinker:

>$joe = User::where('username', 'joe')->first()
>$joe->fullName
Smith Joe // Oh no! Theres a bug!
>eval(RELOAD)

INFO Goodbye.

Psy Shell v0.12.4 (PHP 8.4.1 — cli) by Justin Hileman
Tinker Reload Mod
Vars: $joe
> $joe
= App\Models\User {#5175
name: "Joe",
}
> $joe->fullName
Joe Smith

This allows the developer to constantly test and tweak and develop interactively!

This mod saves me at least 30 minutes a day and I love it.

Check it out here: https://github.com/benfaerber/laravel-tinker-reload-mod

https://redd.it/1iyjd4g
@r_php
Opensource project with paid version. What workflow?

I have a few personal, private projects (mainly Symfony based) with some commercial potential. I'm considdering releasing a opensource base version, but would also like to explore the possibility of maintaining a paid, more advanced version.

How would one organize the development workflow of something like this? If I were to maintain 2 seperate repositories/codebases, changes affecting both versions would need to be applied to both codebases. Depending on the difference, there might be common parts, parts that behave differently between versions, of parts that are only present in one of the two versions.

I assume some problems can be solved with a good branching strategy in a single repository, others maybe with git submodules. But which would be "leading"? The advanced version that is then stripped down to the base version, of the base version that is then enriched with the advanced features?

I assume there's not single right way to do this, and for me it's a first. So if anyone has done something similar, I would really like to hear your experience with this.

https://redd.it/1iyvion
@r_php
Choosing a DB for Laravel production

I am relatively new to Laravel and my experience with DB in the past have been small personal projects that ran fine on SQLite. I am planning on launching my first SaaS soon and even though I am not expecting hundreds of thousands of users, it will be more than my previous projects. I have never used a MySQL or Postgres DB before. I have developed my project on my Mac using SQLite, but should I use MySQL or Postgres in production? Will there be hurdles when switching DBs from dev to production? Is there much difficulty in using MySQL instead of SQLite besides the connection environment variables?

https://redd.it/1iywwpd
@r_php
Laravel is going in the wrong direction IMHO

People will probably downvote me for this and say it's a skill issue, and maybe it is... But I think Laravel is going in the wrong direction.

I installed a new Laravel 12 app today and have no clue what the heck I am looking at.

1. Jetstream is end of life (why?) and the replacement starter kits come without basic things like 2FA. Instead now Laravel is pushing a 3rd party API called "WorkOS". WorkOS claims the first million users are free (until it's not and you're locked in...) but I just want my auth to be local, not having to rely on some third party. This should have been made optional IMHO.

2. I am looking at the Livewire starter kit. Which is now relying on Volt, so now I have to deal with PHP + HTML + JS in the same file. I thought we stopped doing this back in 2004?

3. Too much magic going on to understand basic things. The starter kits login.blade.php:

new #Layout('components.layouts.auth') class extends Component {
#Validate('required|string|email')


What is this?! Why is it using an attribute for the class name?

4. This starter kit now uses Flux for it's UI instead of just plain Tailwind. Now I don't particularly dislike Flux, but it feels this was done to push users to buy Calebs "Pro" plan.

It used to be so easy. Install Laravel, perhaps use a starter kit like Jetstream to quickly scaffold some auth and UI and you could build. It was always fairly easy to rip out Tailwind and use whatever you wanted instead too. Now it's way too complicated with Volt, Flux, no Jetstream, unclear PHP attributes, mixing HTML/PHP/JS etc...

Am I the only one?

https://redd.it/1iyyxk4
@r_php
I got DeepSeek running with PHP (the model, not an API call)

Hey everyone!

I found this library that runs ONNX models inside of vanilla PHP code, and decided to try and make it my mission to get an LLM model running with it.

Here's a video showing it off.

Ended up accomplishing it (kind of) with a distilled 1.5B DeepSeek model and a custom tokenizer class that was drawn up like 80% with Claude.

The model returns back generated text successfully, although it gets stuck in some weird repetitive loops. That could probably be optimized out, I think it's due to the way that the existing generated text is fed back into the model, but I'm happy with the proof of concept!

Full source code is here if you would like to play around with it, or see it for yourself.

https://redd.it/1iz1n59
@r_php
What's the point in using a starter kit?

I'm not asking about the new starter kits, but rather just starter kits in general.

With the Laravel 12 release, we saw that Jetstream and Breeze were effectively deprecated. What's to say that 3-4 years from now, these new starters kits won't get deprecated in favor of the next new thing?

Using a starter kit to hit the ground running sounds great on paper, but I feel like it's not sustainable. I might use a starter kit for a hobby project that I'll realistically abandon at some point, but I don't think I'd ever recommend a business to use one.

Was anyone using Breeze or Jetstream for business? How are you taking the news? If you could go back in time and choose differently, would you roll your own website without a starter kit?

https://redd.it/1iz1sgg
@r_php
Improving Filament’s Docs & Education in v4

Hey everyone! As we gear up for Filament v4, one of our big priorities is rewriting the documentation to make it clearer, more complete, and easier to navigate. At the same time, we’re planning a wider education strategy, probably including official video courses.

But we need your feedback! If you've learned Filament - whether recently or way back in v1 - what were the biggest pain points?

🔸 What parts of the docs confused you or felt incomplete?

🔸 What concepts took you the longest to understand?

🔸 What would have helped you get productive with Filament faster?

One thing we are for sure improving is the accessibility of the "utility injection" parameters you have available in each configuration function. In v4 it will be clear exactly which can be injected in each function.

Some topics might not fit perfectly in the docs, but they could be covered in video examples - so if you’ve ever thought, "I wish there was a video demonstrating a use case for X!", let us know!

We want to make sure Filament v4 is as accessible as possible, whether you're building your first admin panel or scaling a complex multi-panel app. Your feedback will directly shape the next generation of learning resources.

Drop your thoughts in the comments! We’re listening.

https://redd.it/1izdfkm
@r_php
Blasp v2 Release

Hey Laravel Devs

Last year, I created and released Blasp, a profanity filter for Laravel. To my surprise, it’s now grown to over **200 GitHub stars** and **18K downloads**—definitely not what I expected!

Shortly after launching, my wife and I welcomed our daughter into the world, so I’ve been off the grid for a bit. During that time, I received a lot of messages about **issues and feature requests**, so I decided to put together a **v2 release** to make Blasp even better!

# 🔥 What’s New in v2.0?

🚀 **Caching System for Improved Performance**

* Profanity expressions are now cached for faster repeated checks
* Added `php artisan blasp:clear` command to clear cache

**New** `configure()` **Method for Custom Lists**

* Define **custom profanity lists** and **false positive lists**
* Example usage: `$blasp = Blasp::configure( profanities: $your_custom_list, falsePositives: $your_custom_false_positives )->check($text);`

🔧 **Refactored Configuration**

* Supports **custom lists & cached expressions**
* More structured and flexible configuration options

⚙️ **Breaking Changes**

* **Removed language support** for better maintainability
* **Updated method signatures** for configuration
* **New config structure** (migration guide included)

view the full notes here [https://github.com/Blaspsoft/blasp/releases/tag/v2.0.0](https://github.com/Blaspsoft/blasp/releases/tag/v2.0.0)


Enjoy and will look forward to any feedback!

https://redd.it/1izfi8h
@r_php
What websocket solutions you use in your PHP project, and why?

Hi there, I'm curious to see what websocket solutions other devs use for their applications, and why (tradeoffs). What are your use cases?

https://redd.it/1izkuxv
@r_php