diff --git a/README.md b/README.md index 9df0c48..69b909a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Latest Kompass Version](https://img.shields.io/packagist/v/secondnetwork/kompass.svg?style=for-the-badge&label=Kompass&labelColor=FFA700&color=1A2A2C)](https://github.com/secondnetwork/kompass) [![Laravel](https://img.shields.io/badge/v10.X-999999?style=for-the-badge&label=Laravel&labelColor=eb4432&color=1A2A2C)](https://laravel.com) -[![PHP 8.1](https://img.shields.io/badge/v8.2-999999?style=for-the-badge&label=PHP&labelColor=777BB4&color=1A2A2C)](https://php.com) +[![PHP 8.1](https://img.shields.io/badge/v8.1-999999?style=for-the-badge&label=PHP&labelColor=777BB4&color=1A2A2C)](https://php.com) [![License](https://img.shields.io/github/license/secondnetwork/kompass?style=for-the-badge)](https://github.com/secondnetwork/kompass) ## The development of Kompass @@ -21,11 +21,11 @@ But built with the power of Tailwind, Alpine.js, Laravel and Livewire. ## Requirements Additionally Kompass requires you to use -- PHP 8.2 or newer +- PHP 8.1 or newer - Laravel 10.0 or newer - Laravel Fortify 1.16 or newer - Livewire 3.0 or newer -- Tailwindcss 3.4 or newer +- Tailwindcss 3.3 or newer ## Installation diff --git a/app/Providers/KompassServiceProvider.php b/app/Providers/KompassServiceProvider.php index db1b64d..5b0436d 100644 --- a/app/Providers/KompassServiceProvider.php +++ b/app/Providers/KompassServiceProvider.php @@ -53,23 +53,5 @@ public function boot() Fortify::twoFactorChallengeView(function () { return view('auth.two-factor-challenge'); }); - - $roles = Role::with('users')->get(); - - $permissionsArray = []; - foreach ($roles as $role) { - $permissionsArray[$role->slug][] = $role->id; - // foreach ($role->slug as $permissions) { - // $permissionsArray[$permissions->title][] = $role->id; - // } - } - - // Every permission may have multiple roles assigned - foreach ($permissionsArray as $title => $roles) { - Gate::define($title, function ($user) use ($roles) { - // We check if we have the needed roles among current user's roles - return count(array_intersect($user->roles->pluck('id')->toArray(), $roles)) > 0; - }); - } } } diff --git a/resources/lang/de.json b/resources/lang/de.json index 31b6af0..73368de 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -150,6 +150,7 @@ "Create API Token": "API-Token erstellen", "Create Account": "Neues Konto registrieren", "Create New Team": "Neues Team erstellen", + "Create Password": "Passwort erstellen", "Create Team": "Team erstellen", "Create a new team to collaborate with others on projects.": "Erstellen Sie ein neues Team, um mit anderen an Projekten zusammenzuarbeiten.", "Created.": "Erstellt.", @@ -171,6 +172,7 @@ "Delete Selected": "Delete Selected", "Delete Team": "Team löschen", "Denmark": "Denmark", + "Description": "Beschreibung", "Detach": "Detach", "Detach Resource": "Detach Resource", "Detach Selected": "Detach Selected", @@ -278,6 +280,7 @@ "India": "India", "Indonesia": "Indonesia", "Invalid signature.": "Ungültige Signatur.", + "Invitation to access of": "Einladung zum Zugriff auf", "Iran, Islamic Republic Of": "Iran", "Iraq": "Iraq", "Ireland": "Ireland", diff --git a/resources/lang/de/kompass.php b/resources/lang/de/kompass.php index 9a11cdf..000c764 100644 --- a/resources/lang/de/kompass.php +++ b/resources/lang/de/kompass.php @@ -16,4 +16,5 @@ 'Team Settings' => 'ST', 'Forgot your password?' => 'PAASSSSjdagjkb', 'failed' => 'Diese Kombination aus Zugangsdaten wurde nicht in unserer Datenbank gefunden.', + 'Invitation to access website' =>'Einladung zum Zugriff von Webseite' ]; diff --git a/resources/views/livewire/roles.blade.php b/resources/views/livewire/roles.blade.php index c2d94a7..3545ad9 100644 --- a/resources/views/livewire/roles.blade.php +++ b/resources/views/livewire/roles.blade.php @@ -23,7 +23,9 @@ @endif - + + + @@ -46,7 +48,9 @@ @endif - + + + diff --git a/resources/views/mail/invitation.blade.php b/resources/views/mail/invitation.blade.php index 3d96632..5610510 100644 --- a/resources/views/mail/invitation.blade.php +++ b/resources/views/mail/invitation.blade.php @@ -12,7 +12,7 @@ # {{__('Hello')}} 👋 {{ $datamessage['name'] ?? ''}}, -**{{__('you have been granted access to Kompass admin panel')}}.** +**{{__('Invitation to access of').' '.env('APP_NAME')}}.** {{__('With your email')}}: **{{ $datamessage['email'] ?? ''}}** diff --git a/src/Commands/KompassCommand.php b/src/Commands/KompassCommand.php index 839f7eb..71909f5 100644 --- a/src/Commands/KompassCommand.php +++ b/src/Commands/KompassCommand.php @@ -19,6 +19,7 @@ use function Laravel\Prompts\info; use function Laravel\Prompts\note; +use function Laravel\Prompts\warning; use function Laravel\Prompts\password; use function Laravel\Prompts\select; use function Laravel\Prompts\text; @@ -79,14 +80,14 @@ protected function sendSuccessMessage(): void { $loginUrl = env('APP_URL').'/login'; note('Kompass is now installed.'); - info("Logging into your Application at {$loginUrl} with you credentials"); + info("Logging at {$loginUrl} with you credentials."); } public function handle(): int { $this->options = $this->options(); - info('Welcome to the installation of Kompass A Laravel CMS'); + info('Welcome to the installation of Kompass A Laravel CMS.'); $publishAssets = select( label: 'Install Frontend Themen?', @@ -110,7 +111,7 @@ public function handle(): int } $this->publishAssets(); - + warning('Warning: Have you made a backup of you database?'); $database = select( label: 'Drop all tables from the database? For a new installation of Kompass!', options: [ @@ -121,23 +122,26 @@ public function handle(): int if ($database) { $this->databaserun(); - $this->createUser(); - } else { - $addNewUser = select( - label: 'Create new Admin User?', - options: [ - true => 'Yes', - false => 'no', - ] - ); + } - if ($addNewUser) { - $this->createUser(); - } + $addNewUser = select( + label: 'Create new Admin User?', + options: [ + true => 'Yes', + false => 'no', + ] + ); + + if ($addNewUser) { + $this->createUser(); } - Artisan::call('optimize:clear'); - Artisan::call('storage:link'); + $this->call('optimize:clear'); + + $linkPath = public_path('storage'); + if (!file_exists($linkPath)) { + $this->call('storage:link'); + } $this->sendSuccessMessage(); return static::SUCCESS; @@ -227,8 +231,8 @@ public function databaserun() { // Database seeders... (new Filesystem)->copyDirectory(__DIR__.'/../database/seeders', 'database/seeders'); - Artisan::call('migrate:fresh'); - Artisan::call('db:seed'); + $this->call('migrate:fresh'); + $this->call('db:seed'); $this->info('migrate Database and seed data ...'); } diff --git a/src/Mail/Invitation.php b/src/Mail/Invitation.php index 14a734a..b2e972d 100644 --- a/src/Mail/Invitation.php +++ b/src/Mail/Invitation.php @@ -4,6 +4,7 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; +use Illuminate\Support\Facades\Lang; use Illuminate\Queue\SerializesModels; class Invitation extends Mailable @@ -30,6 +31,6 @@ public function __construct($maildata) */ public function build() { - return $this->markdown('kompass::mail.invitation'); + return $this->markdown('kompass::mail.invitation')->subject(Lang::get('Invitation to access of').' '.env('APP_NAME')); } } diff --git a/stubs/app/Models/User.php b/stubs/app/Models/User.php index a5f22a0..c0621f1 100644 --- a/stubs/app/Models/User.php +++ b/stubs/app/Models/User.php @@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; -class User extends Authenticatable implements MustVerifyEmail +class User extends Authenticatable { // use HasApiTokens; use HasFactory; @@ -45,11 +45,11 @@ class User extends Authenticatable implements MustVerifyEmail 'two_factor_secret', ]; - /* - protected $casts = [ - 'email_verified_at' => 'datetime', - ]; - */ + + protected $casts = [ + 'email_verified_at' => 'datetime', + ]; + public static function search($search) {