public function store(Request $request) { $this->validate($request, ['name' => 'required', 'mobile' => 'required']); $store = new Store(); $store->fill($request->all()); $store->save(); return response()->json(['id' => $store->id]); }