diff --git a/app/Http/Livewire/Form/LoginForm.php b/app/Http/Livewire/Form/LoginForm.php new file mode 100644 index 0000000..01568cf --- /dev/null +++ b/app/Http/Livewire/Form/LoginForm.php @@ -0,0 +1,43 @@ + 'required|string|min:3', + 'password' => 'required|string', + ]; + + public function submit() + { + $this->validate(); + + $cred = [ + 'username' => $this->username, + 'password' => $this->password + ]; + + if (!Auth::attempt($cred)) { + session()->flash('message', __('auth.failed')); + return; + } + + return redirect()->intended('/admin'); + } + + /** + * Render the setup page + */ + public function render() + { + return view('form.login'); + } +} diff --git a/resources/views/form/login.blade.php b/resources/views/form/login.blade.php new file mode 100644 index 0000000..136441e --- /dev/null +++ b/resources/views/form/login.blade.php @@ -0,0 +1,17 @@ +
+ @if (Session::has('message')) +

{{ Session::get('message') }}

+ @endif + +
+ Username + +
+ +
+ + +
+ + +