Browse Forum Podcast
All ThreadsLeaderboard
  1. Discussions

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

Ligonsker's avatar

How do I add a JS script file to my blade with Vite?

Hi I created a file at /resources/js/my-script.js I'm completely new to Vite, how can I make this file work on one of my Blade files? Do I first need to add it to the main app.js somehow and rebuild and then it will be visible? But how exactly? ** Update: I made it work by importing the JS file inside the app.js: import './my-script.js'; But does it mean I have to import each

Ligonsker's avatar
Ligonsker's avatar martinbean7mos agoVite
2
1
Last reply by martinbean 7mos ago
BGoole's avatar

How to prevent/disable the back button on a browser using Laravel

I built an order system for a tablet. Because it's a web app (Laravel Breeze), I'm worried that if users press the back button—on the OS or browser—it could crash the system. How do i prevent/disable the browsers backbutton and the Tablet back button.

BGoole's avatar
BGoole's avatar martinbean7mos agoLaravel
2
1
Last reply by martinbean 7mos ago
hunterhawley-45374036's avatar

What's the deal with Livewire and CSRF?

Hey there! I recently spun up a new Laravel v12.4.1 app with Livewire v3.6.2 and am having trouble with 419 errors when using wire:click on a button. I have a resources/views/thing-recorder/show.blade.php file that imports a layout found at resources/views/components/layouts/thing-recorder.blade.php. In the layout, I have the following in my <head>: <meta name="cs

hunterhawley-45374036's avatar
hunterhawley-45374036's avatar Darkdawg7mos agoLivewire
13
1
Last reply by Darkdawg 7mos ago
Darkdawg's avatar

Change default auth redirect url for starter kit?

I'm using the Laravel 12 Livewire starter kit. I wanted to change the dashboard name to something else, but I see the auth redirect url is hardcoded to look for dashboard and home somewhere deep in the framework. So if I visit /login after already being authenticated, it redirects me to /dashboard, and if I change the dashboard route and name it takes me to the front page inste

Darkdawg's avatar
Darkdawg's avatar sheilong7mos agoLaravel
4
1
Last reply by sheilong 7mos ago
laracoft's avatar

Replacing a middleware in L11's bootstrap/app.php

I have some customization in L10's Http/Kernel.php, and now need to convert to L11's bootstrap/app.php because a package requires it How do I replace the middleware 'auth' with another class in L11's app.php syntax?

laracoft's avatar
laracoft's avatar laracoft7mos agoLaravel
1
1
bisonbrah's avatar

Sage (Roots) WordPress Dev Transitioning Into Laravel - Course Recommendations?

Hey everyone, I’m a long-time WordPress developer working heavily with the Sage framework (Roots ecosystem, Blade, Composer, MVC-ish patterns, etc.), and I’m starting to move deeper into Laravel. Since a lot of Sage’s conventions mirror Laravel, I’m looking for guidance on the most effective Laracasts course progression for someone coming from that background. If anyone here ha

bisonbrah's avatar
bisonbrah's avatar LaryAI7mos agoGeneral
1
1
Last reply by LaryAI 7mos ago
Rumnaz khan's avatar

Laravel date field automatically changes to today's date

so, I have this production schedule table: product | date | forecasted | real | created_at | updated_at when updating, only the 'real' field needs to be updated. so , in my view I have: <div class="row"> <input type="hidden" name="ps_id"> // i have rendered this data through js <div class="col-m

Rumnaz khan's avatar
Rumnaz khan's avatar arozhnov7mos agoLaravel
4
1
Last reply by arozhnov 7mos ago
lucian.mihalache's avatar

Laravel 9 mutators for custom attributes

Hello world I am trying to make use of laravel 9's way of doing accessors and mutators but I am having an issue. I have some columns in the database that are very badly named (like FirstN, Adr, CPost) [And no, unfortunately I cannot change the columns]. I want to make some accessors and mutators for these columns that are named right. So I came up with something like this:

lucian.mihalache's avatar
lucian.mihalache's avatar Artwork7mos agoEloquent
4
1
Last reply by Artwork 7mos ago
lookdee's avatar

Laravel Cloud IP Addresses

Does anyone know where Laravel is showing us which IP addresses our apps might be running from? I have a couple of integrations that require white listed IPs, but can't find anywhere on Laravel Cloud side which IP addresses are currently in the pool.

lookdee's avatar
lookdee's avatar ranamoizha...7mos agoLaravel
3
1
Last reply by ranamoizhaider 7mos ago
vitnasinec's avatar

FluxUi modal + lightbox

Hello, I have FluxUi modal which displays some image thumbnails. I want to open full sized images in lightbox. Problem is most lightbox plugins add its code to the end of body, outside of the modal code. The modal uses dialog element and always overlays the lightbox. I havent found a way to overlay the dialog. When I force the lightbox to generate its code inside the dialog the

vitnasinec's avatar
vitnasinec's avatar LaryAI7mos agoGeneral
1
1
Last reply by LaryAI 7mos ago
ibrahim-elshorbagy's avatar

Laravel React Inertia | when client open it from browser history it open JSON return not a component

i have problem with all Inertia Projects when the user open the page from his browser history it open a JSON not a react page how can i prevent this i have "dependencies": { "@inertiajs/react": "^2.0.12", "axios": "^1.10.0", "react": "^19.1.0", "react-dom": "^19.1.0", "swiper": &

ibrahim-elshorbagy's avatar
ibrahim-elshorbagy's avatar JussiManni...7mos agoInertia
4
1
Last reply by JussiMannisto 7mos ago
somenet77's avatar

Horizon trigger max timeout.

I have currently cloned my old app to the new Laravel VPS cloud. But there is an issue with Laravel Horizon in the new Laravel VPS . The horizon run in the older server still works perfectly, but it doesn't work in the new cloned server. I get either Illuminate\Queue\TimeoutExceededException or Illuminate\Queue\MaxAttemptsExceededException error.

somenet77's avatar
somenet77's avatar somenet777mos agoForge
2
1
Last reply by somenet77 7mos ago
Developer654079525's avatar

Updating strategies

Should I regularly update the framework using composer update? I also have composer on the hosting account.

Developer654079525's avatar
Developer654079525's avatar JussiManni...7mos agoLaravel
6
1
Last reply by JussiMannisto 7mos ago
kramsuiluj's avatar

Inserting data into db using php artisan tinker

I have a function inside my model class that inserts data into the database it's something like this: public function insert($name){ $this->name = $name; } Then on the terminal I'm calling the function to insert a data: $project->insert('Test') $project->save() I am able to insert data into the database, but when I want to insert another set of data the first one th

kramsuiluj's avatar
kramsuiluj's avatar kramsuiluj7mos agoLaravel
4
3
Last reply by kramsuiluj 7mos ago
Ligonsker's avatar

Please help me understand how am I supposed to work with Vite

Currently the app has 2 entry points for the JS and CSS files in the blade layout file: @vite(['resources/css/app.css', 'resources/js/app.js']) But, I have many other JS and CSS files inside /resources/js and /resources/css. How am I supposed to deal with it? Let's say I have another blade view that uses the above layout: {{-- my_view.blade.php --}} @extends('layouts.app') @s

Ligonsker's avatar
Ligonsker's avatar aryanmalla...7mos agoVite
1
1
Last reply by aryanmalla19 7mos ago
razu2021's avatar

Stater kit Problem

composer create-project laravel/laravel my-project after install laravel12 i want to install starter kit , its posible or not ? composer global require laravel/installer laravel new my-app composer global update laravel/installer i will try this .. but not update to laravel12 how to solve this problem ??

razu2021's avatar
razu2021's avatar HectorOrdo...7mos agoLaravel
12
1
Last reply by HectorOrdonez 7mos ago
Ligonsker's avatar

Does it make sense to separate data fetching logic from a controller to somewhere else?

Hi, I want to start a new project that is using Blade. I was wondering if it makes sense to separate all the data fetching logic into some sort of API, so that in the future, if I ever need to fetch data with another frontend (React for example), i will have the same API. For example, if right now I have a page that shows list of items: public function itemsList(Request $reques

Ligonsker's avatar
Ligonsker's avatar martinbean7mos agoDesign
6
1
Last reply by martinbean 7mos ago
ezmiks's avatar

Model Structure: defining 1:M over M:M relationship

Hi, I'm currently designing our database structure, and I'm currently struggling wether to define 1-to-many or Many-to-many. So, here's a sample scenario: Let's say I have the following entities: Hero City At first glance, we know that a Hero may save many Cities, and a City can be saved by many Heroes. So we can already say there's a M:M relationship there. But is it accepta

ezmiks's avatar
ezmiks's avatar martinbean7mos agoLaravel
9
1
Last reply by martinbean 7mos ago
ctrlaltdelme's avatar

Issues working between Linux and Windows environments

I'm working on a hobby project with a friend from work. I'm working in Linux and he's on Windows. We're using my repo as the base. When he cloned the repo and went to run npm install and composer install, it ran successfully, but then when he tried to run composer dev he gets an error regarding pcntl. The error says "The [pcntl] extension is required to run Pail". Tem

ctrlaltdelme's avatar
ctrlaltdelme's avatar martinbean7mos agoLaravel
16
3
Last reply by martinbean 7mos ago
MN1's avatar

Using Laravel to display movie collection DB w filters?

Hi All, Front-end developer here looking to make a database challenge for myself: I'm thinking of creating a database of my disc-based movie/tv collection (I have some DVDs, some Blu-Rays, most are movies, some are TV shows) and connecting to some movie-based API to get the duration in minutes and year of release, and display that on a one-page site with sorting functionality a

MN1's avatar
MN1's avatar kevinbui7mos agoLaravel
18
1
Last reply by kevinbui 7mos ago
gaiustemple's avatar

Eloquent new vs make

Hi, Am I right in thinking that $xyz = SomeModel::make([ 'attributes' => $abc ]); $xys->save(); Is just an arguably nicer way of doing $xyz = new SomeModel([ 'attributes' => $abc ]); $xyz->save(); Is make going to be deprecated (or is it in the docs and I just missed it)?

gaiustemple's avatar
gaiustemple's avatar kevinbui7mos agoEloquent
7
1
Last reply by kevinbui 7mos ago
shimana's avatar

Jobs exist in DB but aren't processed

Hello everyone, I am facing a strange issue with Laravel Queues on my production server. Everything works perfectly on my local machine, but after deploying to the production server, the queue worker seems to ignore the jobs. The Problem: I am using the database driver. The jobs are successfully dispatched and inserted into the jobs table. However, they remain there indefinitel

shimana's avatar
shimana's avatar kevinbui7mos agoLaravel
5
2
Last reply by kevinbui 7mos ago
Johna's avatar

Throttle after authentication

I have this rate limiter RateLimiter::for('some-task', function ($request) { return Limit::perHour(10)->by($request->user()->id); }); I want to use it after a user is authenticated Route::post('todo', [TaskController::class, 'task']) ->middleware(['auth', 'throttle:some-task']); However, I get an error attempt to read property id on null I'm sure it'

Johna's avatar
Johna's avatar Johna7mos agoLaravel
6
1
Last reply by Johna 7mos ago
leandrocaplan's avatar

Avoiding Redundant Data in an Eloquent Model Instance

How’s it going? Greetings from Argentina! I’d like to share an issue I encountered while working on a Laravel project of mine, intended for property rentals. In the database, both the property owner’s and the tenant’s contact information are stored in the same table. The MySQL 'datos_contacto' (contact_data) table looks like this: id tipo_usuario email horar

leandrocaplan's avatar
leandrocaplan's avatar leandrocap...7mos agoEloquent
5
2
Last reply by leandrocaplan 7mos ago
drissboumlik's avatar

Auth via Laravel passport to access blade views

I'm using laravel passport and no password column in users table and I have to display an admin panel how can this work exactly without password thanks in advance

drissboumlik's avatar
drissboumlik's avatar martinbean7mos agoLaravel
23
1
Last reply by martinbean 7mos 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.