-
app/helpers.php
Open in GitHubif (! function_exists('msg_success')) { /** * Flash success message. * * @param string $message * @return void */ function msg_success($message) { session()->flash('flash', ['message' => $message, 'level' => 'success']); } } //
-
composer.json
Open in GitHub// "autoload": { "psr-4": { "App\\": "app/", "Database\\Factories\\": "database/factories/", "Database\\Seeders\\": "database/seeders/" }, "files": ["app/helpers.php"] }, //
-
app/Http/Controllers/ConfirmedEmailController.php
Open in GitHubuse App\Models\User; use Illuminate\Http\Request; use Illuminate\Http\Response; class ConfirmedEmailController extends Controller { public function store(Request $request) { auth()->logout(); abort_if(! $request->hasValidSignature(), Response::HTTP_FORBIDDEN); $user = User::find($request->user); abort_if($user === null, Response::HTTP_FORBIDDEN); $user->update([ 'email' => $request->new_email, ]); msg_success('Your email has been successfully update.'); return redirect()->route('login'); } }