/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Requests\CreateMakerRequest $request) { // $values = $request->only(['name', 'phone']); Maker::create($values); return response()->json(['message' => 'The maker create corectly', 'code' => 201], 201); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateMakerRequest $request) { $values = $request->only(['name', 'phone']); //return 'right'; Maker::create($values); return response()->json(['message' => 'Maker correctly added'], 200); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateMakerRequest $request) { $data = $request->only('name', 'phone'); if ($maker = Maker::create($data)) { return response()->json(['message' => "Maker was created with id:{$maker->id}"], 200); } return response()->json(['message' => 'There was a problem'], 422); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(CreateMakerRequest $request) { // Accept only name and phone from $request $values = $request->only(['name', 'phone']); // To validate values in our request we need to create a request // controller using artisan, our new request will be CreateMakerRequest Maker::create($values); return response()->json(['message' => 'Maker added successfully'], 201); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateMakerRequest $request) { $values = $request->only(['name', 'phone']); $maker = Maker::create($values); return response()->json(['message' => "Maker correctly added with id: {$maker->id}"], 201); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateMakerRequest $request) { $values = $request->only(['name', 'phone']); Maker::create($values); return response()->json(['message' => 'The operation was correctly dooded'], 201); }
public function store(CreateMakerRequest $request) { $data = $request->only(['name', 'phone']); Maker::create($data); return $this->responseCreated('Maker was created.'); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateMakerRequest $request) { $values = $request->only(['name', 'phone']); Maker::create($values); return response()->json(['message' => 'Maker is added'], 201); }