What are you using for your PHP dev setup?
I have decided to shift away from front-end development and get back into PHP. Back in the day I used XAMPP, but since I have moved to Linux and we're living in the future, I wanted to go for something more modern while still keeping it relatively simple.
My goal was to make a rootless Podman container running FrankenPHP in classic mode. That way I would keep the toolchain off the host machine, preventing conflicts between projects using different versions of PHP and also making it easier to recreate the environment. After a bit of a struggle getting it all working, I have realized that VS Code needs PHP for validation and stuff. I have tried making a wrapper that would forward VSC's requests to PHP inside the container, but that ended up being sloooow.
Before burning any more time, I have decided to check around the Internet for what people were using. I have seen Laravel's Sail, Laragon, Lando, DDev and possibly others. However, from my brief examination it looked like they all basically do the same thing I was trying, they just set up some extra tools. I would like to keep the control of doing things manually, and they wouldn't actually solve the VSC/PHP issue as far as I can tell.
So, what are you guys doing? Are you using a container and eating the delay (or is there a solution for that)? Are you developing old-school directly on the host OS (how are you managing PHP versions)? Or is there something else you would recommend?
EDIT: Whew, thanks for all the responses, everyone.
One thing I forgot to mention in the post is that, even though I'm using VS Code for now, I'm trying not to get locked down in proprietary stuff. Attaching to Docker container (which I have conflated with Dev Containers in some comments, my bad) requires a proprietary Microsoft extension. The only equivalent in other editors seems to be in PHPStorm. However, I have now realized that Intelephense doesn't actually rely on a PHP interpreter, which should allow me to sidestep that issue.
Those ready-made container solutions seem to be really popular, so I think I might give Ddev a closer look.
https://redd.it/1rnkta8
@r_php
I have decided to shift away from front-end development and get back into PHP. Back in the day I used XAMPP, but since I have moved to Linux and we're living in the future, I wanted to go for something more modern while still keeping it relatively simple.
My goal was to make a rootless Podman container running FrankenPHP in classic mode. That way I would keep the toolchain off the host machine, preventing conflicts between projects using different versions of PHP and also making it easier to recreate the environment. After a bit of a struggle getting it all working, I have realized that VS Code needs PHP for validation and stuff. I have tried making a wrapper that would forward VSC's requests to PHP inside the container, but that ended up being sloooow.
Before burning any more time, I have decided to check around the Internet for what people were using. I have seen Laravel's Sail, Laragon, Lando, DDev and possibly others. However, from my brief examination it looked like they all basically do the same thing I was trying, they just set up some extra tools. I would like to keep the control of doing things manually, and they wouldn't actually solve the VSC/PHP issue as far as I can tell.
So, what are you guys doing? Are you using a container and eating the delay (or is there a solution for that)? Are you developing old-school directly on the host OS (how are you managing PHP versions)? Or is there something else you would recommend?
EDIT: Whew, thanks for all the responses, everyone.
One thing I forgot to mention in the post is that, even though I'm using VS Code for now, I'm trying not to get locked down in proprietary stuff. Attaching to Docker container (which I have conflated with Dev Containers in some comments, my bad) requires a proprietary Microsoft extension. The only equivalent in other editors seems to be in PHPStorm. However, I have now realized that Intelephense doesn't actually rely on a PHP interpreter, which should allow me to sidestep that issue.
Those ready-made container solutions seem to be really popular, so I think I might give Ddev a closer look.
https://redd.it/1rnkta8
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Deploy & Update automation
TL/DR: what are anno 2026 the best options to automate and manage deploying & updating +200 Symfony application+mysql instances?
A bit of context first: I'm a freelance developer who worked mostly in enterprise environments for the past decade, using multiple techstacks (mostly .NET, node, react, graphQL...) deploying to both on-prem infrastructure using TeamCity as to Azure AKS and some legacy stuff using github actions. But we always had a capable DevOps team handling the config & security setup.
Now I've joined a former colleague who started his own business years ago, who has a software suite and a solid userbase (+200 clients) but his associate & lead dev left and I've agreed to bridge the gap and help him out. I do have +10y experience with PHP Laravel&Symfony though mainly smaller apps & websites, no real scaling experience (I maintain around 10 apps hosted on my own dedicated servers at OVH - lots of headroom costing around 200$ a month).
They currently use Ansible to deploy an application instance-per-client, each with it's own isolated database, but there's no real dashboard or management tool to govern all this.
Now that they continue to scale they are running into issues as it's always the company owner handling deploys & upgrades, lots of manual work. His hosting cost currently runs at 2500-3000$/month.
They are in the middle of stripping out all Laravel dependencies and creating a new version following Symfony8 best practises, but still no (shared runtime) multi-tennant solution - it remains a seperate instance per client and the owner wants to keep it like that.
Looking at average loads etc, it would make sense to put some clients on a seperate VM while other could easily be grouped into 5-10 per server instance.
All clients are local to Belgium & the Netherlands as the application's function is to handle local administration & regulations (also does accounting & erp & process automation etc). Expansion to Germany & France are on the long-term roadmap - expected growth around 25% a year.
What are good options here? Both for hosting as for orchestration & automation tooling.
Free tooling compared to complete PAAS solutions?
https://redd.it/1rou542
@r_php
TL/DR: what are anno 2026 the best options to automate and manage deploying & updating +200 Symfony application+mysql instances?
A bit of context first: I'm a freelance developer who worked mostly in enterprise environments for the past decade, using multiple techstacks (mostly .NET, node, react, graphQL...) deploying to both on-prem infrastructure using TeamCity as to Azure AKS and some legacy stuff using github actions. But we always had a capable DevOps team handling the config & security setup.
Now I've joined a former colleague who started his own business years ago, who has a software suite and a solid userbase (+200 clients) but his associate & lead dev left and I've agreed to bridge the gap and help him out. I do have +10y experience with PHP Laravel&Symfony though mainly smaller apps & websites, no real scaling experience (I maintain around 10 apps hosted on my own dedicated servers at OVH - lots of headroom costing around 200$ a month).
They currently use Ansible to deploy an application instance-per-client, each with it's own isolated database, but there's no real dashboard or management tool to govern all this.
Now that they continue to scale they are running into issues as it's always the company owner handling deploys & upgrades, lots of manual work. His hosting cost currently runs at 2500-3000$/month.
They are in the middle of stripping out all Laravel dependencies and creating a new version following Symfony8 best practises, but still no (shared runtime) multi-tennant solution - it remains a seperate instance per client and the owner wants to keep it like that.
Looking at average loads etc, it would make sense to put some clients on a seperate VM while other could easily be grouped into 5-10 per server instance.
All clients are local to Belgium & the Netherlands as the application's function is to handle local administration & regulations (also does accounting & erp & process automation etc). Expansion to Germany & France are on the long-term roadmap - expected growth around 25% a year.
What are good options here? Both for hosting as for orchestration & automation tooling.
Free tooling compared to complete PAAS solutions?
https://redd.it/1rou542
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
finally found a bundle that solves Symfony validation the way it should work
been frustrated with validation boilerplate in Symfony for a while, tried a few approaches, nothing felt clean
this one uses JSON Schema as single source of truth — no more scattered constraints, works well with OpenAPI too. prety much validates anything without the usual mess
if ur building APIs with Symfony u probably know the pain. drop a comment if u want the link, happy to share
https://redd.it/1rov8ud
@r_php
been frustrated with validation boilerplate in Symfony for a while, tried a few approaches, nothing felt clean
this one uses JSON Schema as single source of truth — no more scattered constraints, works well with OpenAPI too. prety much validates anything without the usual mess
if ur building APIs with Symfony u probably know the pain. drop a comment if u want the link, happy to share
https://redd.it/1rov8ud
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Weekly help thread
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1rot8d7
@r_php
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1rot8d7
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Introducing Super Native: The New Architecture for NativePHP
https://www.youtube.com/watch?v=GUEv69p8ojk
https://redd.it/1roybz7
@r_php
https://www.youtube.com/watch?v=GUEv69p8ojk
https://redd.it/1roybz7
@r_php
YouTube
Super Native Explained
NativePHP just changed forever.
In this video, I break down our new architecture — internally called Super Native — and why it completely eliminates the traditional bridge between PHP and native.
We now run PHP in shared memory, embedded directly inside…
In this video, I break down our new architecture — internally called Super Native — and why it completely eliminates the traditional bridge between PHP and native.
We now run PHP in shared memory, embedded directly inside…
SymfonyLive Paris 2026: Les Lightning Talks sont la !
https://symfony.com/blog/symfonylive-paris-2026-les-lightning-talks-sont-la?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1rp5lhr
@r_php
https://symfony.com/blog/symfonylive-paris-2026-les-lightning-talks-sont-la?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1rp5lhr
@r_php
Symfony
SymfonyLive Paris 2026: Les Lightning Talks sont la ! (Symfony Blog)
Vous avez 7 minutes et une idée ? Les lightning talks de SymfonyLive Paris 2026 sont votre moment pour briller !
I wrote a free book about Domain-Driven Design in Laravel
I’ve been using DDD for a long time, so about 3 months ago I wrote a small book about applying it in Laravel. I didn’t publish it right away because I wanted to simplify it as much as possible. I’m not a big fan of heavy theory, so the book is very practical. Enjoy...
https://mayahi.net/books/domain-driven-design-in-laravel
https://redd.it/1rpagd1
@r_php
I’ve been using DDD for a long time, so about 3 months ago I wrote a small book about applying it in Laravel. I didn’t publish it right away because I wanted to simplify it as much as possible. I’m not a big fan of heavy theory, so the book is very practical. Enjoy...
https://mayahi.net/books/domain-driven-design-in-laravel
https://redd.it/1rpagd1
@r_php
mayahi.net
Domain-Driven Design in Laravel — PHP/Laravel & Python/FastAPI Engineer — AI Enthusiast
Ahmad Mayahi — PHP/Laravel & Python/FastAPI Engineer — AI Enthusiast
TIL There's a built-in validation rule in Laravel to check if the user password has been leaked before. I love finding these little gems out of nowhere.
https://redd.it/1rr4s2e
@r_php
https://redd.it/1rr4s2e
@r_php
Reddit
From the laravel community on Reddit: TIL There's a built-in validation rule in Laravel to check if the user password has been…
Explore this post and more from the laravel community
Shop Performance in 30 Tagen
Der Praxisleitfaden für Shopware-Entwickler und Architekten
https://leanpub.com/shopware-performance
https://redd.it/1rrjf6f
@r_php
Der Praxisleitfaden für Shopware-Entwickler und Architekten
https://leanpub.com/shopware-performance
https://redd.it/1rrjf6f
@r_php
Leanpub
Shop Performance in 30 Tagen
Shopware 6 Performance-Optimierung in 30 Tagen. Praxisleitfaden mit 24 Kapiteln, 68 Diagnose-Scripts und GitHub-Repository. Core Web Vitals, Caching, Redis, Elasticsearch, Datenbank-Tuning. Von Mehmet Gökçe – 26 Jahre E-Commerce-Erfahrung. Für Entwickler…
µJS: add AJAX navigation to any PHP app with one script tag
https://mujs.org
https://redd.it/1rrl448
@r_php
https://mujs.org
https://redd.it/1rrl448
@r_php
µJS
µJS — Lightweight AJAX Navigation Library
Accelerate your website without a JS framework. Lightweight AJAX navigation library — 5KB gzipped, zero dependencies, drop-in compatible.
Swoole 6.2.0: added support for io_uring
https://github.com/swoole/swoole-src/releases/tag/v6.2.0
https://redd.it/1rrle0a
@r_php
https://github.com/swoole/swoole-src/releases/tag/v6.2.0
https://redd.it/1rrle0a
@r_php
GitHub
Release v6.2.0 · swoole/swoole-src
✨️ New Features
Added coroutine-based FTP client. By including the --enable-swoole-ftp option during compilation, coroutine support for FTP operations can be enabled, avoiding network blocking.
Ad...
Added coroutine-based FTP client. By including the --enable-swoole-ftp option during compilation, coroutine support for FTP operations can be enabled, avoiding network blocking.
Ad...
Moving from Laravel to Symfony after several years — how hard is it really?
Hi everyone,
I’ve been working almost exclusively with Laravel for several years. Recently I received a really good job offer, but the stack there is based on Symfony.
Over time I’ve moved away from relying heavily on Laravel’s “magic”. In most of my projects I use my own abstraction layers and architecture, and Laravel is mostly used as a boilerplate with routing, Eloquent ORM, and some framework utilities.
Because of that, I’m hoping the transition might not be too painful, but I’m still a bit unsure.
Has anyone here gone through a similar transition from Laravel to Symfony? How difficult was it in practice?
I’d also appreciate any advice on:
* What concepts in Symfony I should focus on first
* What parts usually feel the most unfamiliar for Laravel developers
* Anything that tends to be unexpectedly difficult during the switch
Thanks!
https://redd.it/1rrnqx0
@r_php
Hi everyone,
I’ve been working almost exclusively with Laravel for several years. Recently I received a really good job offer, but the stack there is based on Symfony.
Over time I’ve moved away from relying heavily on Laravel’s “magic”. In most of my projects I use my own abstraction layers and architecture, and Laravel is mostly used as a boilerplate with routing, Eloquent ORM, and some framework utilities.
Because of that, I’m hoping the transition might not be too painful, but I’m still a bit unsure.
Has anyone here gone through a similar transition from Laravel to Symfony? How difficult was it in practice?
I’d also appreciate any advice on:
* What concepts in Symfony I should focus on first
* What parts usually feel the most unfamiliar for Laravel developers
* Anything that tends to be unexpectedly difficult during the switch
Thanks!
https://redd.it/1rrnqx0
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
How the invade package works under the hood to access private methods/properties
https://freek.dev/3048-how-to-easily-access-private-properties-and-methods-in-php
https://redd.it/1rrndte
@r_php
https://freek.dev/3048-how-to-easily-access-private-properties-and-methods-in-php
https://redd.it/1rrndte
@r_php
freek.dev
How to easily access private properties and methods in PHP | freek.dev
Sometimes you need to access a private property or method on an object that isn't yours. Maybe you're writing a test and need to assert some internal state. Maybe you're building a package that needs to reach into another object's internals. Whatever the…
Laravel Site Search v3 is here: crawl and search your entire site using just your database
https://freek.dev/3040-laravel-site-search-v3-is-here-crawl-and-search-your-entire-site-using-just-your-database
https://redd.it/1rrq7z0
@r_php
https://freek.dev/3040-laravel-site-search-v3-is-here-crawl-and-search-your-entire-site-using-just-your-database
https://redd.it/1rrq7z0
@r_php
freek.dev
Laravel Site Search v3 is here: crawl and search your entire site using just your database | freek.dev
We're proud to release v3 of laravel-site-search, a package that crawls and indexes your entire site. Think of it as your own private Google. Point it at a URL, let it crawl every page, and get full-text search results back.
Previous versions required Meilisearch…
Previous versions required Meilisearch…
How to easily access private properties and methods in PHP using invader
https://freek.dev/3048-how-to-easily-access-private-properties-and-methods-in-php
https://redd.it/1rrne9p
@r_php
https://freek.dev/3048-how-to-easily-access-private-properties-and-methods-in-php
https://redd.it/1rrne9p
@r_php
freek.dev
How to easily access private properties and methods in PHP | freek.dev
Sometimes you need to access a private property or method on an object that isn't yours. Maybe you're writing a test and need to assert some internal state. Maybe you're building a package that needs to reach into another object's internals. Whatever the…
A server side analytics tool for Laravel
https://simplestats.io/blog/server-side-analytics-laravel
https://redd.it/1rrrhmc
@r_php
https://simplestats.io/blog/server-side-analytics-laravel
https://redd.it/1rrrhmc
@r_php
simplestats.io
SimpleStats - The missing analytics tool for Laravel applications
A server-side, GDPR compliant and 100% accurate analytics tool, that goes beyond simple counts of views and visits. Discover in-depth metrics like Registrations, Daily Active Users, Average Revenue Per User, campaign ROI and much more!
99.9% type coverage, PHPStan strict, zero N+1 — building a production CRM in PHP 8.4
Hey r/php, I just shipped v3.0 of an open-source CRM I've been building (Relaticle). Wanted to share some PHP-specific engineering decisions, since this community appreciates that kind of thing.
PHP 8.4 strict mode in production: Every class is final. Every file uses strict_types. Typed properties and return types everywhere:
declare(stricttypes=1);
final class People extends Model implements HasCustomFields
{
/** @use HasFactory<PeopleFactory> */
use HasFactory;
use HasUlids;
use SoftDeletes;
use UsesCustomFields;
/** @var list<string> */
protected $fillable = ['name', 'creationsource'];
/ @return BelongsTo<Company, $this> /
public function company(): BelongsTo
{
return $this->belongsTo(Company::class);
}
}
Spatie's laravel-data for typed DTOs:
final class SubscriberData extends Data
{
public function __construct(
public string $email,
public ?string $first_name = '',
public ?string $last_name = '',
# PHP 8.4 with strict_types everywhere is genuinely a joy to write. The language has come so far.
99.9% type coverage: I run PHPStan at level 7 (via Larastan). Every method signature is typed. Every return type is explicit. CI fails on any violation — no exceptions, no baselines.
/ @param Collection<int, Contact> $contacts /
public function processImport(Collection $contacts): ImportResult
{
}
# Is it overkill? Maybe. But in a CRM where data integrity matters (contacts, deals, money), catching type mismatches at static analysis time is cheaper than catching them in production.
N+1 query prevention: One line in AppServiceProvider:
Model::preventLazyLoading(!app()->isProduction());
# Strict lazy loading enabled globally. Forget an eager load? Exception in development. This alone caught 10-20 performance issues before they shipped.
PostgreSQL over MySQL: Migrated from MySQL to PostgreSQL 17+ in v3.0. Key reason: JSONB. I built no-code custom fields — users create fields without touching code. All stored as JSONB with GIN indexes:
-- PostgreSQL JSONB with proper indexing
CREATE INDEX idxcustomfields ON contacts USING GIN (customfields);
-- Partial path queries that MySQL JSON can't do efficiently
SELECT * FROM contacts WHERE customfields->>'industry' = 'SaaS';
# MySQL's JSON type can't do proper indexing or partial path queries at this level. For a CRM with dynamic schemas, PostgreSQL is the better fit.
Testing with Pest: Comprehensive test suite — unit, feature, and browser tests. Pest's syntax makes test writing feel less like a chore:
arch('strict types')
->expect('App')
->toUseStrictTypes();
arch('avoid open for extension')
->expect('App')
->classes()
->toBeFinal();
});
# Architecture tests prevent structural issues at CI time. If someone accidentally breaks a convention, CI catches it.
Import wizard (the hardest problem): Real-world CSVs are chaos:
Automatic date format detection (uses Laravel's date validator under the hood)
Fuzzy + exact column matching
Relationship mapping (person → company linkage)
Chunked processing for large files
Granular error reporting (which rows failed, why) If anyone's solving CSV import in PHP, happy to discuss approaches.
Stack:
PHP 8.4 + Laravel 12
PostgreSQL 17+ + Redis
Filament 5 + Livewire 4
Docker + docker-compose Links:
GitHub: https://github.com/Relaticle/relaticle (1.2K stars)
Free hosted: [https://relaticle.com](https://relaticle.com) (no credit card)
License: AGPL-3.0. For internal use — no restrictions.
What PHP 8.4 features have you found most useful in production? Curious what patterns this community is adopting
https://redd.it/1rru8yy
@r_php
Hey r/php, I just shipped v3.0 of an open-source CRM I've been building (Relaticle). Wanted to share some PHP-specific engineering decisions, since this community appreciates that kind of thing.
PHP 8.4 strict mode in production: Every class is final. Every file uses strict_types. Typed properties and return types everywhere:
declare(stricttypes=1);
final class People extends Model implements HasCustomFields
{
/** @use HasFactory<PeopleFactory> */
use HasFactory;
use HasUlids;
use SoftDeletes;
use UsesCustomFields;
/** @var list<string> */
protected $fillable = ['name', 'creationsource'];
/ @return BelongsTo<Company, $this> /
public function company(): BelongsTo
{
return $this->belongsTo(Company::class);
}
}
Spatie's laravel-data for typed DTOs:
final class SubscriberData extends Data
{
public function __construct(
public string $email,
public ?string $first_name = '',
public ?string $last_name = '',
# PHP 8.4 with strict_types everywhere is genuinely a joy to write. The language has come so far.
99.9% type coverage: I run PHPStan at level 7 (via Larastan). Every method signature is typed. Every return type is explicit. CI fails on any violation — no exceptions, no baselines.
/ @param Collection<int, Contact> $contacts /
public function processImport(Collection $contacts): ImportResult
{
}
# Is it overkill? Maybe. But in a CRM where data integrity matters (contacts, deals, money), catching type mismatches at static analysis time is cheaper than catching them in production.
N+1 query prevention: One line in AppServiceProvider:
Model::preventLazyLoading(!app()->isProduction());
# Strict lazy loading enabled globally. Forget an eager load? Exception in development. This alone caught 10-20 performance issues before they shipped.
PostgreSQL over MySQL: Migrated from MySQL to PostgreSQL 17+ in v3.0. Key reason: JSONB. I built no-code custom fields — users create fields without touching code. All stored as JSONB with GIN indexes:
-- PostgreSQL JSONB with proper indexing
CREATE INDEX idxcustomfields ON contacts USING GIN (customfields);
-- Partial path queries that MySQL JSON can't do efficiently
SELECT * FROM contacts WHERE customfields->>'industry' = 'SaaS';
# MySQL's JSON type can't do proper indexing or partial path queries at this level. For a CRM with dynamic schemas, PostgreSQL is the better fit.
Testing with Pest: Comprehensive test suite — unit, feature, and browser tests. Pest's syntax makes test writing feel less like a chore:
arch('strict types')
->expect('App')
->toUseStrictTypes();
arch('avoid open for extension')
->expect('App')
->classes()
->toBeFinal();
});
# Architecture tests prevent structural issues at CI time. If someone accidentally breaks a convention, CI catches it.
Import wizard (the hardest problem): Real-world CSVs are chaos:
Automatic date format detection (uses Laravel's date validator under the hood)
Fuzzy + exact column matching
Relationship mapping (person → company linkage)
Chunked processing for large files
Granular error reporting (which rows failed, why) If anyone's solving CSV import in PHP, happy to discuss approaches.
Stack:
PHP 8.4 + Laravel 12
PostgreSQL 17+ + Redis
Filament 5 + Livewire 4
Docker + docker-compose Links:
GitHub: https://github.com/Relaticle/relaticle (1.2K stars)
Free hosted: [https://relaticle.com](https://relaticle.com) (no credit card)
License: AGPL-3.0. For internal use — no restrictions.
What PHP 8.4 features have you found most useful in production? Curious what patterns this community is adopting
https://redd.it/1rru8yy
@r_php
GitHub
GitHub - relaticle/relaticle: The Next-Generation Open-Source CRM Platform written with Laravel and Filament
The Next-Generation Open-Source CRM Platform written with Laravel and Filament - relaticle/relaticle
Appel à settings/password depuis mon front SPA Nuxt
Hello,
mon front SPA Nuxt fait un appel PUT à l'endpoint de Laravel Fortify /settings/password lorsque le user connecté veut modifier son mot de passe depuis son dashboard. Le mot de passe est bien enregistré mais la réponse est une redirection alors que je veux que ce soit une réponse JSON avec un message de succès ou d'erreur.
Comment faire ?
Merci
Voici mes bouts de code:
Fonction appelée par le formulaire:
const resetPassword = async () => {
loading.value = true
try {
const data = await api('/settings/password', {
method: 'PUT',
body: {
currentpassword: currentPassword.value,
password: password.value,
passwordconfirmation: passwordConfirmation.value,
}
})
status.value = 'success'
message.value = 'Mot de passe modifié avec succès'
currentPassword.value = ''
password.value = ''
passwordConfirmation.value = ''
} catch (err: any) {
console.log(err);
status.value = 'error'
message.value = err.data?.message || 'Une erreur est survenue'
} finally {
loading.value = false
}
}
Le composable useApiFetch:
export function useApiRequest() {
const config =
useRuntimeConfig
()
const xsrfToken =
useCookie
('XSRF-TOKEN')
return
$fetch
.create({
baseURL: config.public.apiBase,
credentials: 'include',
headers: {
'Accept': 'application/json',
'X-XSRF-TOKEN': xsrfToken.value || '',
},
})
}
La Response de l'appel à l'endpoint contient un Header Location qui entraîne la tentative de redirection.
https://redd.it/1rrxwgz
@r_php
Hello,
mon front SPA Nuxt fait un appel PUT à l'endpoint de Laravel Fortify /settings/password lorsque le user connecté veut modifier son mot de passe depuis son dashboard. Le mot de passe est bien enregistré mais la réponse est une redirection alors que je veux que ce soit une réponse JSON avec un message de succès ou d'erreur.
Comment faire ?
Merci
Voici mes bouts de code:
Fonction appelée par le formulaire:
const resetPassword = async () => {
loading.value = true
try {
const data = await api('/settings/password', {
method: 'PUT',
body: {
currentpassword: currentPassword.value,
password: password.value,
passwordconfirmation: passwordConfirmation.value,
}
})
status.value = 'success'
message.value = 'Mot de passe modifié avec succès'
currentPassword.value = ''
password.value = ''
passwordConfirmation.value = ''
} catch (err: any) {
console.log(err);
status.value = 'error'
message.value = err.data?.message || 'Une erreur est survenue'
} finally {
loading.value = false
}
}
Le composable useApiFetch:
export function useApiRequest() {
const config =
useRuntimeConfig
()
const xsrfToken =
useCookie
('XSRF-TOKEN')
return
$fetch
.create({
baseURL: config.public.apiBase,
credentials: 'include',
headers: {
'Accept': 'application/json',
'X-XSRF-TOKEN': xsrfToken.value || '',
},
})
}
La Response de l'appel à l'endpoint contient un Header Location qui entraîne la tentative de redirection.
https://redd.it/1rrxwgz
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Livestream: Road to Laracon with Aaron Francis and Zuzana Kunckova
I often see people asking about getting started with conference speaking and eventually speaking at larger conferences like a Laracon, so I figured it was time to actually dig into it.
Tomorrow (3/12) at 12pm EDT (4pm UTC), I'm going live with Aaron Francis and Zuzana Kunckova to talk about the road to conference speaking. We'll be covering where talk ideas come from, CFP submissions, what goes into preparing a talk, and working your way up from meetups to a Laracon. Aaron and Zuzana will also be sharing their own paths to the Laracon stage.
Would love to see you there! Drop any questions here ahead of time or ask in chat during the stream.
Stream link: https://www.youtube.com/watch?v=FuQjSPBIHlo
https://redd.it/1rr61vr
@r_php
I often see people asking about getting started with conference speaking and eventually speaking at larger conferences like a Laracon, so I figured it was time to actually dig into it.
Tomorrow (3/12) at 12pm EDT (4pm UTC), I'm going live with Aaron Francis and Zuzana Kunckova to talk about the road to conference speaking. We'll be covering where talk ideas come from, CFP submissions, what goes into preparing a talk, and working your way up from meetups to a Laracon. Aaron and Zuzana will also be sharing their own paths to the Laracon stage.
Would love to see you there! Drop any questions here ahead of time or ask in chat during the stream.
Stream link: https://www.youtube.com/watch?v=FuQjSPBIHlo
https://redd.it/1rr61vr
@r_php
YouTube
Road to Speaking at Laracon w/ Aaron and Zuzana
What does it take to go from wanting to speak at conferences to standing on the Laracon stage?
Aaron Francis and Zuzana Kunckova join the stream to talk about their paths to conference speaking. We’ll discuss where talk ideas come from, how to write a CFP…
Aaron Francis and Zuzana Kunckova join the stream to talk about their paths to conference speaking. We’ll discuss where talk ideas come from, how to write a CFP…