middleware('guest'); } public function makeBarcodeExample(Request $request) { $label = $request->barcode; $barcode_generator = new Picqer\Barcode\BarcodeGeneratorPNG(); $barcode = $barcode_generator->getBarcode($label, $barcode_generator::TYPE_CODE_128); echo ''; echo '
'.$label; } public function makeBarcode(Request $request) { $label = $request->barcode; $barcode_generator = new Picqer\Barcode\BarcodeGeneratorPNG(); $barcode = $barcode_generator->getBarcode($label, $barcode_generator::TYPE_CODE_128); echo ''; echo '
'.$label; } protected function validator(array $data) { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:8', 'confirmed'], 'barcode' => ['required', 'string'], ]); } /** * Create a new user instance after a valid registration. * * @param array $data * @return \App\User */ protected function createAPI(Request $request) { $user = User::create([ 'name' => $request->name, 'email' => $request->email, 'password' => Hash::make($request->password), ]); return response()->json($user, 201); } protected function create(array $data) { #self::makeBarcode($data['barcode']); return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']), ]); } }