Website Updated January 2023!

Weekly Nugget Series - Laravel Spark

#programming nugget

#laravel

Laravel Spark "Class "App\Models\User::class\" not found"

I am going to start this quick series, where I discover some of the cool stuff about laravel, ruby, javascript, react, vuejs, zapier, or any other stuff that's relevant to the audience. Hope u guys enjoy it. I think I've to research these things again and again.

Today's discussion is on Laravel Spark

I was researching initially adding some feedback on my site to create subscriptions, although I was having a hard time figuring out how to add custom models in Laravel Spark

"Class "App\Models\User::class\" not found"

My editor wasn't helpful to figure this out. I decided to start googling and yet, no relevant information was posted. So here is a quick solution to it. You would add "App\Models\User" without ":: class" in your env file. Just like the example below. I was confused initially, then decided to go without the class inside my .env file and it worked.

CASHIER_MODEL=WebApp\Domain\Users\User

Hope you guys enjoy this quick solution. Have a nice weekend!