Support the ongoing development of →
posted 4 years ago
Last updated 1 year ago.

First of all I would create the route in routes/api.php file to have the api namespace and other api (optional) authentications available (check official docs)

To validate the data you can simply create form request validation on store() function

To store the data in the DB you can create fillable attribute on User model with array of fields that can be populated by mass assignment and just do User::create($request->all())

You don't have to create custom controller (but you can if you want of course)

Laravel is just... beautiful! :)

Last updated 4 years ago.

I would add some sort of security to your endpoint or anyone could post to create a new user

Make an api post route , example api/create-user

Point it to a controller method Example Public function create(Request $request){

$user = new User; $user->myfield_1 = “my data where “; $user->save();


Post your data from your external app to your new endpoint in laravel


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.