Loop trough and return a collection to view

Hi, I have saved YouTube channel ID's saved in my database. I would like to do the Youtube API call for each channel ID's in my controller and then return it to the view so...

Count Ping Time

So am working on an application where the customer need to know how long each devices turned on per day so the first idea that came to my mind is to ping devices IP until g...

How To Return Relationship With Created Record

Hi, I am trying to return a user with the associated role after I create the new user. I am not sure if this is possible but currently it will return all users with roles b...

Broadcast just added model data

Hello, Laracasts. I want to use Laravel events broadcasting for refreshing my blade view with socket.io. When I save record I fire the event in my controller method like...

Display Date on Pages Site Wide (via Master Layout through Include)

I have a header page, which is included (@include) in a master layout page. I would like to display users day and date on the header row. As...

Exists in a table validation issue

It's Tuesday morning and I'm under the weather, so my brain must be missing something jsut a validation request where my last rule is causing an issue. I need to validate t...

Issue with vue's dinamic component

Hi everybody, I'm making an admin panel for my application using vue, since there are lots of modals and logic in the admin panel I decided to go for vuex and dinamic compo...

Laravel storing images outside public directory

Hello, I'm trying to store images using the local driver. I have followed docs and created the symbolic link php artisan storage:link I'm saving a file...

Job Chaining

Hi, Did anyone try doing this: DownloadInvoice::withChain([ new AnnotateInvoice, new SendInvoiceToDropbox ])->dispatch($invoic...
Laravel
11
21

Trying to get property of non-object

Hello to all! I have this problem. I have a model Portfolio in which there is an img property. This property is stored in the database in JSON format. {"...

Laravel not redirecting me to homepage after axios login

Hi everybody, I'm using laravel's auth system for my laravel-vue application (via auth:make cli). How I login works is via post axios call to laravel's login route,...

Display result of Artisan command executed via controller

Via controller we can execute artisan command using facade Artisan::call('command:name'); But how to display in view the result of command line, for example if comma...

Performant way to mass "update or create"

Hi, I'm looking for a way to do something like updateOrCreateMany (imaginary method).Currently, the code looks like this: class ActivityReposito...

Validate Integrity constraint violation

I have a table with composite unique key for a polymorphic relation. How to validate an unique composite key with laravel validation?...

Laravel where('user_id') seems completely ignored

I have a problem where user_id seems completely ignored by Laravels Eloquent ORM. Pigeons Table id user_id name father_id mother_...

How to avoid repeating yourself

I want to have this: public function show(User $user) { // } public function edit(User $user) { // } public functio...
Laravel
8
127

Send email to admin when a new user registers

I want to send an email to admin when a new user registers. What I have below can successfully send email to the user who just registered, So I want to know how I will go...

Non-static method Illuminate\Http\Request::ajax()

I'm trying to submit a form using ajax and I'm getting this error. ErrorException in OpenController.php line 78: Non-static method Illuminate\Http\Reque...

Cannot update details of logged in user

I am trying to update the details of the logged-in user: public function update(StoreUser $user) { $loggedInUser = auth()->user();...

Page loads but in network gets 404

Someone has seen something like this? Only in server side, I load my admin page, it shows up normaly, but in network it's receiving a 404, I cant login, cause the route for...
Laravel
31
184
Create a New Discussion Button
Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels