Authentication
To start testing the Pro theme, register as a user or log in using one of the default users:
- admin type - [email protected] with the password secret
- creator type - [email protected] with the password secret
- member type - [email protected] with the password secret
In addition to the features included in the free theme, the Pro theme also has a role management example with an updated user management, as well as tag management, category management and item management examples. Keep in mind that all the features can be viewed once you log in using the credentials provided above or by registering your own user.
Each role has a different privilege level and can perform a certain number of actions according to this level.
A member type user can log in, update his profile and view a list of added items. A creator type user can log in, update his profile and perform actions on categories, tags and items. A admin type user can log in, update his profile and perform actions on categories, tags, items, roles and users.
Login
The login functionality is fully implemented in our theme helping you to start your project in no time. To login into dashboard you just have to add /login in the URL and fill the login form with one of the credentials (user: [email protected], [email protected], [email protected] and password: secret).
The resources/views/auth/login/create.blade.php
is the Laravel Blade file which handles the login form. You can easily adapt it to your needs.
It uses the auth store located in app/Http/Controllers/Auth/LoginController
.
Login Controller
public function store(Request $request)
{
$credentials = $request->only('email', 'password');
$rememberMe = $request->rememberMe ? true : false;
if (Auth::attempt($credentials, $rememberMe)) {
$request->session()->regenerate();
return redirect()->intended('/dashboard');
}
return back()->withErrors([
'message' => 'The provided credentials do not match our records.',
])->withInput($request->only('email'));
}
Register
The register functionality is fully implemented in our theme helping you to start your project in no time. To register a new user you just have to add /register in the URL or click on signup link from login page and fill the register form with user details.
The resources/views/auth/register/create.blade.php
is the Laravel Blade file which handles the register form. You can easily extend it to your needs.
It uses the auth store located in app/Http/Controllers/Auth/Register
.
Register Controller
public function store(Request $request)
{
$request->validate([
'name' => 'required|min:3|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:7|confirmed|max:255',
'role_id' => 'required|integer|between:1,3',
'terms' => 'accepted',
], [
'name.required' => 'Name is required',
'email.required' => 'Email is required',
'password.required' => 'Password is required',
'role_id.required' => 'Role is required',
'terms.accepted' => 'You must accept the terms and conditions'
]);
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'password' => Hash::make($request->password),
'role_id' => $request->role_id,
'profile_picture' => asset('assets/img/default-avatar.png')
]);
Auth::login($user);
return redirect(RouteServiceProvider::HOME);
}