@dsimon24cx What is the URL where you are sending the request?
Have you checked the right url/route name?
php artisan route:list
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello all.
I am currently trying to implement an API in Laravel. But unfortunately without success. Rather with an error message 404 - not found.
I created an API controller in app/Http/Controllers/Api/SocialMediaController.php with the corresponding route in Api.php "Route::apiResource('/socm', 'App\Http\Controllers\Api\SocialMediaController');".
The controller looks like this:
namespace App\Http\Controllers\Api;
use Illuminate\Support\Facades\Storage;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class SocialMediaController extends Controller
{
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$vorname = $request->input('vorname');
$nachname = $request->input('nachname');
$status = $request->input('status');
$email = $request->input('email');
}
}
When I access the API via POST request, I always get the error 404 - not found. Do you guys happen to have any idea what else could be wrong here?
Greetings.
Please or to participate in this conversation.