Authentication

You're browsing the documentation for an old version of MoonShine. Consider upgrading your project to MoonShine 2.x.

# Basics

The Moonshine admin panel implements an authentication system that is enabled by default, but if you need to allow access for all users, you can disable it in the configuration file config/moonshine.php

return [
// ...
'auth' => [
'enable' => true,
// ...
],
// ...
];

# Extending capabilities

If you use your own guard, provider, then they can be redefined in the configuration, as well as the MoonshineUser model

return [
// ...
'auth' => [
// ...
'guard' => 'moonshine',
'guards' => [
'moonshine' => [
'driver' => 'session',
'provider' => 'moonshine',
],
],
'providers' => [
'moonshine' => [
'driver' => 'eloquent',
'model' => MoonshineUser::class,
],
],
// ...
],
// ...
];

If there is a need to add text under the login button (for example, add a registration button), then this can easily be done through the configuration file

return [
// ...
'auth' => [
// ...
'footer' => '<a href="https://cutcode.dev/" target="_blank">CutCode</a>'
],
// ...
],
// ...
];

# Greetings

To change the welcome text on the authentication page, you need to create a language file lang/vendor/moonshine/en/ui.php

return [
// ...
'login' => [
'title' => 'Welcome to :moonshine_title!',
'description' => 'Please sign-in to your account',
],
// ...
];

# Profile

You can override the fields for the profile in the configuration file config/moonshine.php

return [
// ...
'auth' => [
'enable' => true,
'fields' => [
'username' => 'email',
'password' => 'password',
'name' => 'name',
'avatar' => 'avatar'
],
'guard' => 'moonshine',
// ...
],
// ...
];

If you don't want to use an avatar, then specify 'avatar'=>'' or 'avatar'=>false.

If you want to change the look of your profile page, then create a file resources/views/vendor/moonshine/profile.blade.php