/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // To avoid user to request for repair two or more times. Repair::create(array_merge(array_only($request->all(), ['title', 'remark']), ['user_id' => Auth::user()->id, 'type' => Category::getCategoryId('repair.type', $request->input('type')), 'status' => Category::getCategoryId('repair.status', 'submitted')])); return response()->json(['status' => 0]); }