diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 4369d945..e001ab61 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -4,7 +4,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; -use Illuminate\Foundation\Auth\AuthenticatesUsers; +use Zoomyboy\LaravelNami\AuthenticatesNamiUsers; class LoginController extends Controller { @@ -19,7 +19,7 @@ class LoginController extends Controller | */ - use AuthenticatesUsers; + use AuthenticatesNamiUsers; /** * Where to redirect users after login. diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 540d17b4..3a816d81 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -21,7 +21,7 @@ class RouteServiceProvider extends ServiceProvider * * @var string */ - public const HOME = '/home'; + public const HOME = '/'; /** * Define your route model bindings, pattern filters, etc. diff --git a/app/User.php b/app/User.php index e79dab7f..38eb8a40 100644 --- a/app/User.php +++ b/app/User.php @@ -3,37 +3,10 @@ namespace App; use Illuminate\Contracts\Auth\MustVerifyEmail; -use Illuminate\Foundation\Auth\User as Authenticatable; +use Zoomyboy\LaravelNami\NamiUser as Authenticatable; use Illuminate\Notifications\Notifiable; class User extends Authenticatable { - use Notifiable; - - /** - * The attributes that are mass assignable. - * - * @var array - */ - protected $fillable = [ - 'name', 'email', 'password', - ]; - - /** - * The attributes that should be hidden for arrays. - * - * @var array - */ - protected $hidden = [ - 'password', 'remember_token', - ]; - - /** - * The attributes that should be cast to native types. - * - * @var array - */ - protected $casts = [ - 'email_verified_at' => 'datetime', - ]; + } diff --git a/composer.json b/composer.json index 9e74fccb..d5e3f3ba 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,9 @@ "framework", "laravel" ], + "repositories": [ + { "type": "path", "url": "./packages/laravel-nami", "options": {"symlink": true} } + ], "license": "MIT", "require": { "php": "^7.2.5", @@ -16,7 +19,8 @@ "laravel/framework": "^7.0", "laravel/tinker": "^2.0", "laravel/ui": "^2.0", - "spatie/laravel-medialibrary": "^7.19" + "spatie/laravel-medialibrary": "^7.19", + "zoomyboy/laravel-nami": "dev-master" }, "require-dev": { "facade/ignition": "^2.0", diff --git a/composer.lock b/composer.lock index 6cfe67d2..9b8d4677 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d3a7d51481df2c886f69c3071572c278", + "content-hash": "62db182c80f51832cfe1d9cef34a9063", "packages": [ { "name": "asm89/stack-cors", @@ -1571,16 +1571,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.3.0", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc" + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc", - "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", "shasum": "" }, "require": { @@ -1619,7 +1619,7 @@ "parser", "php" ], - "time": "2019-11-08T13:50:10+00:00" + "time": "2020-04-10T16:34:50+00:00" }, { "name": "opis/closure", @@ -4384,6 +4384,38 @@ } ], "time": "2020-03-13T01:23:26+00:00" + }, + { + "name": "zoomyboy/laravel-nami", + "version": "dev-master", + "dist": { + "type": "path", + "url": "./packages/laravel-nami", + "reference": "ac5c544c32b21f5f6b0c281b216baa13ab2feda8" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Zoomyboy\\LaravelNami\\NamiServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Zoomyboy\\LaravelNami\\": "src/" + } + }, + "authors": [ + { + "name": "Philipp Lang", + "email": "philipp@zoomyboy.de" + } + ], + "description": "Authentication provider against NaMi for Laravel", + "transport-options": { + "symlink": true + } } ], "packages-dev": [ @@ -6406,7 +6438,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "zoomyboy/laravel-nami": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/config/app.php b/config/app.php index 2cb752e3..a3bcbd07 100644 --- a/config/app.php +++ b/config/app.php @@ -80,7 +80,7 @@ return [ | */ - 'locale' => 'en', + 'locale' => 'de', /* |-------------------------------------------------------------------------- @@ -106,7 +106,7 @@ return [ | */ - 'faker_locale' => 'en_US', + 'faker_locale' => 'de_DE', /* |-------------------------------------------------------------------------- diff --git a/config/auth.php b/config/auth.php index aaf982bc..987ae562 100644 --- a/config/auth.php +++ b/config/auth.php @@ -67,8 +67,8 @@ return [ 'providers' => [ 'users' => [ - 'driver' => 'eloquent', - 'model' => App\User::class, + 'driver' => 'nami', + 'model' => \App\User::class ], // 'users' => [ diff --git a/resources/js/layouts/App.vue b/resources/js/layouts/App.vue index 659dfdc5..3b8d8e9b 100644 --- a/resources/js/layouts/App.vue +++ b/resources/js/layouts/App.vue @@ -5,6 +5,7 @@ <wrapper admin-toolbar="adminToolbar" profile-toolbar="profileToolbar" + search-background="bg-primary-600" > <template slot="mainnav"> <mainnav name="main" sm></mainnav> diff --git a/resources/js/views/Login.vue b/resources/js/views/Login.vue index c99fda59..86e3daa3 100644 --- a/resources/js/views/Login.vue +++ b/resources/js/views/Login.vue @@ -10,7 +10,7 @@ </item> <item> - <f-password label="Gruppierungsnr" v-model="values.groupid"></f-password> + <f-text label="Gruppierungsnummer" v-model="values.groupid"></f-text> </item> <item> @@ -28,7 +28,11 @@ export default { data: function() { return { - values: {} + values: { + mglnr: 90166, + password: 'ibm0g', + groupid: 100105 + } }; }, methods: { diff --git a/resources/lang/de/auth.php b/resources/lang/de/auth.php new file mode 100644 index 00000000..24d74c85 --- /dev/null +++ b/resources/lang/de/auth.php @@ -0,0 +1,17 @@ +<?php + +return [ + /* + |-------------------------------------------------------------------------- + | Authentication Language Lines + |-------------------------------------------------------------------------- + | + | The following language lines are used during authentication for various + | messages that we need to display to the user. You are free to modify + | these language lines according to your application's requirements. + | + */ + + 'failed' => 'Diese Kombination aus Zugangsdaten wurde nicht in unserer Datenbank gefunden.', + 'throttle' => 'Zu viele Loginversuche. Versuchen Sie es bitte in :seconds Sekunden nochmal.', +]; diff --git a/resources/lang/de/pagination.php b/resources/lang/de/pagination.php new file mode 100644 index 00000000..b2816268 --- /dev/null +++ b/resources/lang/de/pagination.php @@ -0,0 +1,17 @@ +<?php + +return [ + /* + |-------------------------------------------------------------------------- + | Pagination Language Lines + |-------------------------------------------------------------------------- + | + | The following language lines are used by the paginator library to build + | the simple pagination links. You are free to change them to anything + | you want to customize your views to better match your application. + | + */ + + 'previous' => '« Zurück', + 'next' => 'Weiter »', +]; diff --git a/resources/lang/de/passwords.php b/resources/lang/de/passwords.php new file mode 100644 index 00000000..15c662ce --- /dev/null +++ b/resources/lang/de/passwords.php @@ -0,0 +1,20 @@ +<?php + +return [ + /* + |-------------------------------------------------------------------------- + | Password Reminder Language Lines + |-------------------------------------------------------------------------- + | + | The following language lines are the default lines which match reasons + | that are given by the password broker for a password update attempt + | has failed, such as for an invalid token or invalid new password. + | + */ + + 'reset' => 'Das Passwort wurde zurückgesetzt!', + 'sent' => 'Passworterinnerung wurde gesendet!', + 'throttled' => 'Bitte warten Sie, bevor Sie es erneut versuchen.', + 'token' => 'Der Passwort-Wiederherstellungs-Schlüssel ist ungültig oder abgelaufen.', + 'user' => 'Es konnte leider kein Nutzer mit dieser E-Mail-Adresse gefunden werden.', +]; diff --git a/resources/lang/de/validation.php b/resources/lang/de/validation.php new file mode 100644 index 00000000..ea3301c3 --- /dev/null +++ b/resources/lang/de/validation.php @@ -0,0 +1,181 @@ +<?php + +return [ + /* + |-------------------------------------------------------------------------- + | Validation Language Lines + |-------------------------------------------------------------------------- + | + | The following language lines contain the default error messages used by + | the validator class. Some of these rules have multiple versions such + | as the size rules. Feel free to tweak each of these messages. + | + */ + + 'accepted' => ':attribute muss akzeptiert werden.', + 'active_url' => ':attribute ist keine gültige Internet-Adresse.', + 'after' => ':attribute muss ein Datum nach dem :date sein.', + 'after_or_equal' => ':attribute muss ein Datum nach dem :date oder gleich dem :date sein.', + 'alpha' => ':attribute darf nur aus Buchstaben bestehen.', + 'alpha_dash' => ':attribute darf nur aus Buchstaben, Zahlen, Binde- und Unterstrichen bestehen.', + 'alpha_num' => ':attribute darf nur aus Buchstaben und Zahlen bestehen.', + 'array' => ':attribute muss ein Array sein.', + 'before' => ':attribute muss ein Datum vor dem :date sein.', + 'before_or_equal' => ':attribute muss ein Datum vor dem :date oder gleich dem :date sein.', + 'between' => [ + 'numeric' => ':attribute muss zwischen :min & :max liegen.', + 'file' => ':attribute muss zwischen :min & :max Kilobytes groß sein.', + 'string' => ':attribute muss zwischen :min & :max Zeichen lang sein.', + 'array' => ':attribute muss zwischen :min & :max Elemente haben.', + ], + 'boolean' => ":attribute muss entweder 'true' oder 'false' sein.", + 'confirmed' => ':attribute stimmt nicht mit der Bestätigung überein.', + 'date' => ':attribute muss ein gültiges Datum sein.', + 'date_equals' => ':attribute muss ein Datum gleich :date sein.', + 'date_format' => ':attribute entspricht nicht dem gültigen Format für :format.', + 'different' => ':attribute und :other müssen sich unterscheiden.', + 'digits' => ':attribute muss :digits Stellen haben.', + 'digits_between' => ':attribute muss zwischen :min und :max Stellen haben.', + 'dimensions' => ':attribute hat ungültige Bildabmessungen.', + 'distinct' => ':attribute beinhaltet einen bereits vorhandenen Wert.', + 'email' => ':attribute muss eine gültige E-Mail-Adresse sein.', + 'ends_with' => ':attribute muss eine der folgenden Endungen aufweisen: :values', + 'exists' => 'Der gewählte Wert für :attribute ist ungültig.', + 'file' => ':attribute muss eine Datei sein.', + 'filled' => ':attribute muss ausgefüllt sein.', + 'gt' => [ + 'numeric' => ':attribute muss größer als :value sein.', + 'file' => ':attribute muss größer als :value Kilobytes sein.', + 'string' => ':attribute muss länger als :value Zeichen sein.', + 'array' => ':attribute muss mehr als :value Elemente haben.', + ], + 'gte' => [ + 'numeric' => ':attribute muss größer oder gleich :value sein.', + 'file' => ':attribute muss größer oder gleich :value Kilobytes sein.', + 'string' => ':attribute muss mindestens :value Zeichen lang sein.', + 'array' => ':attribute muss mindestens :value Elemente haben.', + ], + 'image' => ':attribute muss ein Bild sein.', + 'in' => 'Der gewählte Wert für :attribute ist ungültig.', + 'in_array' => 'Der gewählte Wert für :attribute kommt nicht in :other vor.', + 'integer' => ':attribute muss eine ganze Zahl sein.', + 'ip' => ':attribute muss eine gültige IP-Adresse sein.', + 'ipv4' => ':attribute muss eine gültige IPv4-Adresse sein.', + 'ipv6' => ':attribute muss eine gültige IPv6-Adresse sein.', + 'json' => ':attribute muss ein gültiger JSON-String sein.', + 'lt' => [ + 'numeric' => ':attribute muss kleiner als :value sein.', + 'file' => ':attribute muss kleiner als :value Kilobytes sein.', + 'string' => ':attribute muss kürzer als :value Zeichen sein.', + 'array' => ':attribute muss weniger als :value Elemente haben.', + ], + 'lte' => [ + 'numeric' => ':attribute muss kleiner oder gleich :value sein.', + 'file' => ':attribute muss kleiner oder gleich :value Kilobytes sein.', + 'string' => ':attribute darf maximal :value Zeichen lang sein.', + 'array' => ':attribute darf maximal :value Elemente haben.', + ], + 'max' => [ + 'numeric' => ':attribute darf maximal :max sein.', + 'file' => ':attribute darf maximal :max Kilobytes groß sein.', + 'string' => ':attribute darf maximal :max Zeichen haben.', + 'array' => ':attribute darf maximal :max Elemente haben.', + ], + 'mimes' => ':attribute muss den Dateityp :values haben.', + 'mimetypes' => ':attribute muss den Dateityp :values haben.', + 'min' => [ + 'numeric' => ':attribute muss mindestens :min sein.', + 'file' => ':attribute muss mindestens :min Kilobytes groß sein.', + 'string' => ':attribute muss mindestens :min Zeichen lang sein.', + 'array' => ':attribute muss mindestens :min Elemente haben.', + ], + 'not_in' => 'Der gewählte Wert für :attribute ist ungültig.', + 'not_regex' => ':attribute hat ein ungültiges Format.', + 'numeric' => ':attribute muss eine Zahl sein.', + 'password' => 'Das Passwort ist falsch.', + 'present' => ':attribute muss vorhanden sein.', + 'regex' => ':attribute Format ist ungültig.', + 'required' => ':attribute muss ausgefüllt werden.', + 'required_if' => ':attribute muss ausgefüllt werden, wenn :other den Wert :value hat.', + 'required_unless' => ':attribute muss ausgefüllt werden, wenn :other nicht den Wert :values hat.', + 'required_with' => ':attribute muss ausgefüllt werden, wenn :values ausgefüllt wurde.', + 'required_with_all' => ':attribute muss ausgefüllt werden, wenn :values ausgefüllt wurde.', + 'required_without' => ':attribute muss ausgefüllt werden, wenn :values nicht ausgefüllt wurde.', + 'required_without_all' => ':attribute muss ausgefüllt werden, wenn keines der Felder :values ausgefüllt wurde.', + 'same' => ':attribute und :other müssen übereinstimmen.', + 'size' => [ + 'numeric' => ':attribute muss gleich :size sein.', + 'file' => ':attribute muss :size Kilobyte groß sein.', + 'string' => ':attribute muss :size Zeichen lang sein.', + 'array' => ':attribute muss genau :size Elemente haben.', + ], + 'starts_with' => ':attribute muss mit einem der folgenden Anfänge aufweisen: :values', + 'string' => ':attribute muss ein String sein.', + 'timezone' => ':attribute muss eine gültige Zeitzone sein.', + 'unique' => ':attribute ist bereits vergeben.', + 'uploaded' => ':attribute konnte nicht hochgeladen werden.', + 'url' => ':attribute muss eine URL sein.', + 'uuid' => ':attribute muss ein UUID sein.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [ + 'name' => 'Name', + 'username' => 'Benutzername', + 'email' => 'E-Mail Adresse', + 'first_name' => 'Vorname', + 'last_name' => 'Nachname', + 'password' => 'Passwort', + 'password_confirmation' => 'Passwort Bestätigung', + 'city' => 'Stadt', + 'country' => 'Land', + 'address' => 'Adresse', + 'phone' => 'Telefonnummer', + 'mobile' => 'Handynummer', + 'age' => 'Alter', + 'sex' => 'Geschlecht', + 'gender' => 'Geschlecht', + 'day' => 'Tag', + 'month' => 'Monat', + 'year' => 'Jahr', + 'hour' => 'Stunde', + 'minute' => 'Minute', + 'second' => 'Sekunde', + 'title' => 'Titel', + 'content' => 'Inhalt', + 'description' => 'Beschreibung', + 'excerpt' => 'Auszug', + 'date' => 'Datum', + 'time' => 'Uhrzeit', + 'available' => 'verfügbar', + 'size' => 'Größe', + 'mglnr' => 'Mitgliesnummer', + 'groupid' => 'Gruppierungsnummer', + ], +];