faker
This commit is contained in:
1 parent
11cb9b03f5
commit
5f95289079
25 files changed
+430
-129
No files matched your search
@@ -6,7 +6,7 @@ use Filament\Support\Contracts\HasColor;
|
||||
use Filament\Support\Contracts\HasIcon;
|
||||
use Filament\Support\Contracts\HasLabel;
|
||||
|
||||
enum ProkektStatus: string implements HasColor, HasIcon, HasLabel
|
||||
enum ProjektStatus: string implements HasColor, HasIcon, HasLabel
|
||||
{
|
||||
case TEST = 'test';
|
||||
case ENTWURF = 'entwurf';
|
||||
|
||||
@@ -76,13 +76,7 @@ class KontosTable
|
||||
TextInput::make('subject')->required(),
|
||||
RichEditor::make('body')->required(),
|
||||
])
|
||||
->action(function (array $data) {
|
||||
Mail::to($this->client)
|
||||
->send(new GenericEmail(
|
||||
subject: $data['subject'],
|
||||
body: $data['body'],
|
||||
));
|
||||
}),
|
||||
->action(function (array $data) {}),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -52,8 +52,8 @@ class ProjekteResource extends Resource
|
||||
{
|
||||
return [
|
||||
'index' => ListProjektes::route('/'),
|
||||
'create' => CreateProjekte::route('/create'),
|
||||
'edit' => EditProjekte::route('/{record}/edit'),
|
||||
// 'create' => CreateProjekte::route('/create'),
|
||||
// 'edit' => EditProjekte::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
namespace App\Filament\Resources\Projektes\Schemas;
|
||||
|
||||
use App\Enums\ProjektStatus;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\Radio;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class ProjekteForm
|
||||
@@ -10,7 +16,13 @@ class ProjekteForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
Select::make('auftraggeber_id')->relationship(name: 'auftraggeber', titleAttribute: 'name'),
|
||||
Select::make('gutachter_id')->relationship(name: 'gutachter', titleAttribute: 'name'),
|
||||
Radio::make('status')->options(ProjektStatus::class),
|
||||
TextInput::make('interner_name'),
|
||||
TextInput::make('ofizieller_name'),
|
||||
Textarea::make('beschreibung'),
|
||||
DatePicker::make('erstellung')->helperText('Datum am Gutachten'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,24 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Scopes\KontoScope;
|
||||
use Database\Factories\GutachterFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Gutachter extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::addGlobalScope(new KontoScope);
|
||||
}
|
||||
|
||||
protected static function newFactory(): Factory
|
||||
{
|
||||
return GutachterFactory::new();
|
||||
}
|
||||
}
|
||||
+25
-17
@@ -2,36 +2,44 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\KontoFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class Konto extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'konto_title',
|
||||
'konto_gender',
|
||||
'konto_first_name',
|
||||
'konto_last_name',
|
||||
'konto_company',
|
||||
'konto_email',
|
||||
'konto_address',
|
||||
'konto_location',
|
||||
'konto_plz',
|
||||
'konto_country',
|
||||
'konto_phone',
|
||||
'konto_uid_number',
|
||||
'konto_agb_akzeptiert',
|
||||
'konto_option_id',
|
||||
'konto_gutachten_zahl',
|
||||
'konto_gutachten_zeit',
|
||||
'konto_gutachten_abgeschlossen',
|
||||
'title',
|
||||
'gender',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'company',
|
||||
'email',
|
||||
'address',
|
||||
'country',
|
||||
'phone',
|
||||
'uid_number',
|
||||
'agb_akzeptiert',
|
||||
'plan_id',
|
||||
'guthaben',
|
||||
'gueltig_bis',
|
||||
'abgeschlossen',
|
||||
];
|
||||
|
||||
protected static function newFactory(): Factory
|
||||
{
|
||||
return KontoFactory::new();
|
||||
}
|
||||
|
||||
public function konto_option(): HasOne
|
||||
{
|
||||
return $this->hasOne(KontoOption::class, 'id', 'konto_option_id');
|
||||
|
||||
@@ -6,5 +6,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Projekte extends Model
|
||||
{
|
||||
//
|
||||
public function auftraggeber()
|
||||
{
|
||||
return $this->belongsTo(Auftraggeber::class);
|
||||
}
|
||||
|
||||
public function gutachter()
|
||||
{
|
||||
return $this->belongsTo(Gutachter::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Auftraggeber;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class AuftraggeberPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Auftraggeber');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Auftraggeber $auftraggeber): bool
|
||||
{
|
||||
return $authUser->can('View:Auftraggeber');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Auftraggeber');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Auftraggeber $auftraggeber): bool
|
||||
{
|
||||
return $authUser->can('Update:Auftraggeber');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Auftraggeber $auftraggeber): bool
|
||||
{
|
||||
return $authUser->can('Delete:Auftraggeber');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Auftraggeber $auftraggeber): bool
|
||||
{
|
||||
return $authUser->can('Restore:Auftraggeber');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Auftraggeber $auftraggeber): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Auftraggeber');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Auftraggeber');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Auftraggeber');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Auftraggeber $auftraggeber): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Auftraggeber');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Auftraggeber');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Methode;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class MethodePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Methode');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Methode $methode): bool
|
||||
{
|
||||
return $authUser->can('View:Methode');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Methode');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Methode $methode): bool
|
||||
{
|
||||
return $authUser->can('Update:Methode');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Methode $methode): bool
|
||||
{
|
||||
return $authUser->can('Delete:Methode');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Methode $methode): bool
|
||||
{
|
||||
return $authUser->can('Restore:Methode');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Methode $methode): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Methode');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Methode');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Methode');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Methode $methode): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Methode');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Methode');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user