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

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 kramsuiluj6mos agoLaravel
4
1
Last reply by kramsuiluj 6mos 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...6mos agoVite
1
1
Last reply by aryanmalla19 6mos 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...6mos agoLaravel
12
10
Last reply by HectorOrdonez 6mos 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 martinbean6mos agoDesign
6
1
Last reply by martinbean 6mos 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 martinbean6mos agoLaravel
9
4
Last reply by martinbean 6mos 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 martinbean6mos agoLaravel
16
4
Last reply by martinbean 6mos 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 kevinbui6mos agoLaravel
18
1
Last reply by kevinbui 6mos 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 kevinbui6mos agoEloquent
7
19
Last reply by kevinbui 6mos 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 kevinbui6mos agoLaravel
5
1
Last reply by kevinbui 6mos 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 Johna6mos agoLaravel
6
1
Last reply by Johna 6mos 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...6mos agoEloquent
5
1
Last reply by leandrocaplan 6mos 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 martinbean6mos agoLaravel
23
3
Last reply by martinbean 6mos ago
Lykos22's avatar

403 access forbidden on storage/public folder

Hi, I have seen the posts from a few other people having the same issue, but although I have tried the suggested solutions I still have this problem getting a 403 access forbidden when trying to access the image url on the browser. I am not sure if it is because my Laravel app is running on Docker, maybe some further input would help. What I have done far: I have created a sym

Lykos22's avatar
Lykos22's avatar islamsamy2...6mos agoLaravel
3
1
Last reply by islamsamy214 6mos ago
bvfi-dev's avatar

Livewire FormObject isDirty() equivalent?

Im trying to use FormObjects for all my livewire components to reduce duplicate code, but I keep running into an issue where I need to check if the model was changed, like when in an edit form and checking if the initial state and save state are different, so that I can save on my API calls. In my Livewire Form, I have: public function preFillEntry(User $entry):void { $entry

bvfi-dev's avatar
bvfi-dev's avatar bvfi-dev6mos agoLivewire
2
1
Last reply by bvfi-dev 6mos ago
dmytroshved's avatar

Laravel Sanctum SPA Auth: 419 Token mismatch error in logout

Hey everyone I am struggling with annoying 419 error trying to logout. The login and register are working fine. My api and spa are on the same top-level domain, but different ports api - localhost:8000 spa (vue) - localhost:5173 After hours of debugging and changing the different settings I still get the 419 backend: env APP_URL=http://localhost:8000 FRONTEND_URL=http://localho

dmytroshved's avatar
dmytroshved's avatar Dmytro_Shv...6mos agoLaravel
13
25
Last reply by Dmytro_Shved 6mos ago
zufflie's avatar

Laravel Pest Test fails when run together, but pass when alone

Hey Guys. I watched Pest Driven Laravel and wanted to implement it in my own personal Project. I have a weird error which i can not get around. I have a Backend Part in Routes, shielded by the these middlewares: Route::middleware(['auth:sanctum', config('jetstream.auth_session'), Admin::class]) Admin::class is just checking. if (! Auth::user()->isAdmin()) { ret

zufflie's avatar
zufflie's avatar Shafqat_al...6mos agoDevOps
6
6
Last reply by Shafqat_ali 6mos ago
sllkevin's avatar

How to return Flux component from a class method?

Is there a way to have a class method return a Flux component? My work around was to create my own blade component to hold the Flux tags then return view('my-flux-component'). But can I just call Flux directly without concatenating a string in the method? For example, I have a list of Posts I want to add an action menu: View, Delete, etc. I want to have an action class that han

sllkevin's avatar
sllkevin's avatar Snapey6mos agoLivewire
3
3
Last reply by Snapey 6mos ago
DhPandya's avatar

Laracasts 2FA

Hello @JeffreyWay First of all, thank you very much for the high-quality content Laracasts provides. Today, I was just walking through the profile section and noticed that Laracasts didn't have 2FA. What are your thoughts on it? Are you adding it by near time? Regards,

DhPandya's avatar
DhPandya's avatar jlrdw6mos agoFeedback
5
1
Last reply by jlrdw 6mos ago
ctrlaltdelme's avatar

The process has been signaled with signal "4" when running tests

When running tests for my Inertia + Vue app, I get the error in the title. Logs here: [2025-11-26 00:59:39] local.ERROR: The process has been signaled with signal "4". {"exception":"[object] (Symfony\\Component\\Process\\Exception\\ProcessSignaledException(code: 0): The process has been signaled with signal \"4\". at /home/ubuntuserver/Phpstor

ctrlaltdelme's avatar
ctrlaltdelme's avatar jlrdw6mos agoLaravel
3
1
Last reply by jlrdw 6mos ago
earmsby's avatar

prompt for input in bulk action?

I have a bulk action on a Filament relation manager that allows the user to move a group of works from one contract to another. Right now (for development) I have hard coded the new contract to move the works to like so: BulkAction::make('move') ->icon(Heroicon::ArrowRight) ->label('Move to contract')

earmsby's avatar
earmsby's avatar earmsby6mos agoFilament
2
1
Last reply by earmsby 6mos ago
sllkevin's avatar

Tinker is returning only the Model namespace, without properties, only sometimes.

Why is this happening? See my first three queries that won't return any data, but using find() works great. I have cleared cache, routes, config. I've dumped autoload. I've downgraded versions. I've tried another project where it works as expected. If I add ->id to any of them, it works. Why?? > \Laravel\Cashier\Subscription::query()->where('id','=','3')->first() =

sllkevin's avatar
sllkevin's avatar tykus6mos agoGeneral
4
3
Last reply by tykus 6mos ago
earmsby's avatar

Search results in Attach method

In a Filament 4 relation manager I have an attach method like this: AttachAction::make() ->label('Link Existing Account') ->schema(fn(AttachAction $action): array => [ $action->getRecordSelect(), Select::make('author_role') ->options(function () {

earmsby's avatar
earmsby's avatar earmsby6mos agoFilament
2
1
Last reply by earmsby 6mos ago
adamnet's avatar

laravel keep pagination after editing a record

Hello. I am using Laravel pagination and would like to know if there is a way after editing a record, to return to the page where this record was found. Any example would help a lot! Thanks

adamnet's avatar
adamnet's avatar adamnet6mos agoLaravel
0
1
rikw's avatar

Flash messages in Livewire

Hi all, By no way can I get flash messages to work in my Lirewire components. Some posts say it cannot be done, others give code sample that do not do anything (for me). Who has the definitive answer? Basically I have a form and a list component. After saving the form I want to redirect to the list and show a flash message that the form was successfully saved. Who can help me o

rikw's avatar
rikw's avatar bvfi-dev6mos agoLivewire
3
4
Last reply by bvfi-dev 6mos ago
pmaechler's avatar

Laravel Authentication partially working

Hello I'm struggeling with an Authentication problem since many hours. Background Created an Application with Laravel 11 from scratch (eloquent, some livewire stuff, etc). Working fine so far Now I need to add authentication and authorization to the app. If possible via Azure socialite plugin. But first I'll do it agains the local database After filling out the login form, i ge

pmaechler's avatar
pmaechler's avatar Snapey6mos agoLaravel
10
11
Last reply by Snapey 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.