Search code examples
laravel-api

Model not found though it exist Laravel 8


I am having a hard time finding what I missed but my model is not detected though it exist. I created the controller,model and migration through "php artisan make:model VacationLeave -m -c". I am using Laravel 8 API and I have this in my controller VacationLeaveController

This is my Route Api Route API And the post man result trying to post a requestPost man result

What I've tried so far:

  1. Renaming and Reinstalling Controller and Model
  2. composer dump-autoload

Any help will be appreciated. Thank you guys


Solution

  • I got it. To import models into controller just use "App\Models\ModelName" instead of "App\Http\Models\ModelName"