Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

aoualmiaabdou's avatar

Spatie/laravel-pdf throw an error in laravel cloud

helo, i try to add pdf generation functionality to my filament dashboard, how ever in my local server everything is fine, but when i deploy the project to laravel cloud this error poop out when i try to generate a pdf : The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=`npm root -g` node '/var/www/html/vendor/spatie/browsershot/src/../bin/browser.cjs' '{&q

aoualmiaabdou's avatar
aoualmiaabdou's avatar aecioneto6mos agoLaravel
7
1
Last reply by aecioneto 6mos ago
stackprogramer's avatar

Why The command "passport:keys" does not exist in php artisan::call

I installed successfully passport package, it works correctly in Laravel controller i need passport key generate again but i have error. How can solve this problem? I don't have access shell exec I want to do it in php. For me it is important to change passport key when I reinstalled my Laravel App. For Laravel key it works but for passport .... More: I have in laravel 10 thee

stackprogramer's avatar
stackprogramer's avatar BMO-VIK6mos agoGeneral
3
1
Last reply by BMO-VIK 6mos ago
dcranmer's avatar

npm run build error: sh: vite: command not found

I'm trying to deploy a refactored Laravel/Inertia/Vue3 app to our "staging" server (which is a test production environment), but can't seem to run vite build. The error I get is: > postinstall > npm run build > build > vite build && vite build --ssr && vite build && vite build --ssr --ssr npm stderr: sh: vite: command not found I s

dcranmer's avatar
dcranmer's avatar marykline1...6mos agoVite
6
3,719
Last reply by marykline120 6mos ago
woogygun's avatar

Validation Errors For Nested Fields

Im trying to validate a nested array of values with laravel. The fields are getting posted off with axios via vuejs as follows. { name: 'john doe', staff_profile: { mobile: '000 111 2222' } { Im validating the fields via a FormRequest object in laravel as follows: return [ 'name' => 'required' 'staff_profile.mobile' => 'required' ]; If the validation fa

woogygun's avatar
woogygun's avatar josepdecid6mos agoVue
3
3
Last reply by josepdecid 6mos ago
jackade2024's avatar

Multiple tables that share the same structure

Hi, I have a problem with multiple tables that share the same structure. For example, I have several orders tables for each year, such as orders_2020, orders_2021, and so on. These tables are created dynamically every year. Now, I want to handle all of them through a single model called OrderAll. I would like to use this model in a way that allows me to access all Eloquent func

jackade2024's avatar
jackade2024's avatar martinbean6mos agoEloquent
6
1
Last reply by martinbean 6mos ago
deebow's avatar

Correct way of executing array of invokable classes

First of all, I'm a Laravel newbie, and feel free to roast what I did :D Before getting to my main question, here’s the context: the app uses a lot of invokable action classes, and they’re executed like this: app(SomeActionClass::class)($data) So here are my questions: If these invokable classes don’t have any dependencies, why call them using app() instead of the classic (ne

deebow's avatar
deebow's avatar martinbean6mos agoCode Review
4
3
Last reply by martinbean 6mos ago
fogley's avatar

Redirecting to route with additional query parameters

I tried redirecting like this... return redirect()->route('home', [ 'param1' => 'val1', 'param2' => 'val2', ]); Expecting it to redirect to the following URL... https://domain.tld/path?param1=val1&param2=val2 However, this is not the case. The array parameter passed to the route() function only seems to take into account variables that have been defined direc

fogley's avatar
fogley's avatar fogley6mos agoLaravel
5
36
Last reply by fogley 6mos ago
3rgo's avatar

Parallel testing with multiple database connections

Hi ! I'm currently working on an API that needs to have multiple database connections. At the moment it uses : 1 MySQL + 1 PostgreSQL + 1 MongoDB. MySQL and PostgreSQL may be merged in the future, but it will at least keep a MongoDB in parallel of the PostgreSQL. Connection to MongoDB is handled by the jenssegers/mongodb package This API is tested with Pest, but the current ~90

3rgo's avatar
3rgo's avatar Čamo6mos agoTesting
7
14
Last reply by Čamo 6mos ago
FireBlade's avatar

Delete Model Livewire Component

I have a Livewire component that deletes models : ... public function setRecord($model,$recordId){ $this->resetDialog(); $this->model = $model; $this->recordId = $recordId; } ... setRecord is called from Blade template : ```php @if($canDelete) <x-jet-dropdown-link @click="Livewire.emit('setDeleteRecord','Post',{

FireBlade's avatar
FireBlade's avatar FireBlade6mos agoLivewire
7
1
Last reply by FireBlade 6mos ago
Darkdawg's avatar

Autocompletion for public/computed properties in Livewire views?

Looking for extensions/tips to improve my VS Code experience with Livewire 3/4 MFC/SFC. I'm currently using the MFC/class based approach, but what bugs me the most is that my views have zero knowledge of my classes, so whenever I reference any variable all I get is (global variable) $category even if this is defined as public Category $category in the class. Not sure if this is

Darkdawg's avatar
Darkdawg's avatar Darkdawg6mos agoLivewire
2
1
Last reply by Darkdawg 6mos ago
Gabotronix's avatar

getting 419 CSFR Token Mismatch on POST/PUT requests to unprotected api routes with axios

I have been getting this error for the last week on all my axios POST/PUT/DELETE requests (GET requests work properly) to my api routes, eventhough I'm not using sanctum or any middleware to protect these routes. I added the proper meta-tag to all my blade files: <meta name="csrf-token" content="{{ csrf_token() }}"> I'm attaching csrf token to all my

Gabotronix's avatar
Gabotronix's avatar Eimmaarose6mos agoGeneral
3
23
Last reply by Eimmaarose 6mos ago
n2fole00's avatar

Xdebug not running on Sail

Hi, I can't get xdebug working on Sail. I've followed the steps in the Laravel Sail docs and also tried this article https://iwasherefirst2.medium.com/how-to-set-up-xdebug-with-laravel-sail-a-complete-guide-98d6498b382a My launch.json is { "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug (Sail)", &q

n2fole00's avatar
n2fole00's avatar jlrdw6mos agoDevOps
1
1
Last reply by jlrdw 6mos ago
Ligonsker's avatar

Using the Laravel 12 + React starter kit, where is a good location to put React components CSS files?

I am using the Laravel 12 + React starter kit, and I want to create several components, for example: app/resources/js/components/Navbar.tsx app/resources/js/components/Footer.tsx app/resources/js/components/Sidebar.tsx And I want each component to have its corresponding css file. I was thinking to have a components folder inside app/resources/css/, like so: app/resources/css/c

Ligonsker's avatar
Ligonsker's avatar JussiManni...6mos agoGeneral
3
1
Last reply by JussiMannisto 6mos ago
mkfizi-29935843's avatar

Laravel Fortify confirm 2FA doesn't throw error for invalid input

Hi, As per title, i'm using Fortify. During confirm 2FA step, my app doesn't return error message when user input wrong code. Below is my form <form method="POST" action="{{ url('/user/confirmed-two-factor-authentication') }}"> @csrf <div class="space-y-1 mt-4"> <x-label for="code">{{ __('Authentication C

mkfizi-29935843's avatar
mkfizi-29935843's avatar mkfizi-299...6mos agoLaravel
1
1
Last reply by mkfizi-29935843 6mos ago
vincent15000's avatar

Splide with a rolling window of 21 items

Hello, It's a project with Laravel and VueJS. I'm using Splide to display a carousel. To avoid to have too many requests, I'd like to load a window around the central item displayed on the screen. For example if I display the first item among 33, I want to display item 1 and also load the 10 previous and 10 next items. As it's the first one to display, I will load the items fro

vincent15000's avatar
vincent15000's avatar vincent150...6mos agoGeneral
0
1
Morph-UK's avatar

UK postcode validator

I built a UK postcode validator for Laravel. Designed to work with Laravel's form validation, but also works manually as a facade pattern. Features: Checks postcode against an external API Uses ONS and Ordnance Survey postcode data Determines postcode country Supports England, Wales, Scotland and Northern Ireland Supports the Isle of Man and the Channel Islands Falls back to r

Morph-UK's avatar
Morph-UK's avatar Morph-UK6mos agoLaravel
0
1
wim91's avatar

What is the best way to prepare a project for deploy?

Hi everyone. I'm starting my first Laravel project and I want to optimize it, specifically removing unnecessary modules that were useful during development but are unlikely to be used anymore. Could you tell me which packages I can definitely remove?

wim91's avatar
wim91's avatar aleahy6mos agoLaravel
4
1
Last reply by aleahy 6mos ago
Developer654079525's avatar

Foreign keys

Must foreign keys be constrained or would a simple unsignedBigInteger type suffice when defining relationships?

Developer654079525's avatar
Developer654079525's avatar bestmomo6mos agoLaravel
2
1
Last reply by bestmomo 6mos ago
shez1983's avatar

Dusk - asserting route path is returns 'route not defined'

$browser ->visit(route('posts.show', ['post' => $old->slug])) ->screenshot(1) ->assertRouteIs(route('posts.show', ['posts' => $old->slug])); so when i see screenshot, I can see dusk has gone to the url - ie correct screenshot.. however assertRoute is.. returns Route [http://laravel.test/posts/environment-neque-as-6914e1669609c] not defined.

shez1983's avatar
shez1983's avatar tykus6mos agoTesting
3
2
Last reply by tykus 6mos ago
reakky's avatar

Livewire auth logic disappeard?

Hey everyone, I recently created a new Laravel 12 project with Livewire starter kit (but without Volt). There used to be an auth directory right inside the App\Livewire folder. But somehow it is gone. Does anyone know where it is?

reakky's avatar
reakky's avatar reakky6mos agoCode Review
0
1
ahoi's avatar

Prevent redirection in Laravel 11 (API-only project)

Laravel 11 came with some kind of new project structure. And now I am facing a problem, which was never a problem to solve for me before: I don't want to redirect a user to /login if the user is not authenticated. In such a szenario, I am getting: Route [login] not defined which originates from vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php:118 What

ahoi's avatar
ahoi's avatar smares6mos agoLaravel
4
3
Last reply by smares 6mos ago
siggi's avatar

get job Id from dispatch in controller

Hello everyone, we currently use laravel 8, and generate a "lock file" that generates an empty file so a "generating..." tile can be displayed in another app. As the job might take some time to be handled, we dispatched from the controller and generated a lock file there like $jobId = $this->dispatch(new ReportExportNew(auth()->user()->id, $serializ

siggi's avatar
siggi's avatar xmsi6mos agoLaravel
11
1
Last reply by xmsi 6mos ago
jaracas's avatar

Can Inertia be used like this? Lots of components that update frequently

I'm starting a new personal project that will have multiple (As many as 10, possibly more) components that need to be updated every 250-500ms with updated data, all the data is pretty lightweight but with 10 components doing it I have to wonder if it'd be better to just use Laravel as an API and poll the server myself with something like axios. For the record, my project is a P

jaracas's avatar
jaracas's avatar Eimmaarose6mos agoInertia
3
3
Last reply by Eimmaarose 6mos ago
BKristof's avatar

When do I *actually* need to restart Reverb?

I've been curious about something for a while now. On a live Laravel app, when does Reverb actually need to be restarted? The docs are pretty vague on this. Currently I am restarting it on every deployment, which causes some annoying cURL errors now and then, since there's a small window of downtime. So, does Reverb need to be restarted for code changes? Like, every time I want

BKristof's avatar
BKristof's avatar tykus6mos agoReverb
1
2
Last reply by tykus 6mos ago
Ligonsker's avatar

Laravel 12 + Vite - File not found when trying to display a background image from a CSS file

I have an svg file placed in /public/assets/icons, and I try to use it from within a CSS file: .some-icon { background-image: url("/assets/icons/arrow.svg"); } I get error 404 Not Found (seen in devtools), but when I try to use the same path and image from within a Blade file as <img>, it works: <img src="/assets/icons/arrow.svg" alt="&quo

Ligonsker's avatar
Ligonsker's avatar tykus6mos agoCode Review
1
1
Last reply by tykus 6mos ago

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.