middleware(RedirectIfShouldNotCreateLicense::class); } public function create(): Factory|View|Application { return view('license.create'); } public function store(License $license): RedirectResponse { request()->validate( [ 'purchase_code' => 'required', ], [ 'required' => 'The purchase code field is required.', ] ); $license->activate(request('purchase_code')); return redirect()->intended(); } }