Erster Upload
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\User\Resources;
|
||||
|
||||
use App\Filament\User\Resources\SupplierResource\Pages;
|
||||
use App\Filament\User\Resources\SupplierResource\RelationManagers;
|
||||
use App\Models\Supplier;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class SupplierResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Supplier::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-user';
|
||||
protected static ?string $navigationLabel = 'Lieferanten';
|
||||
protected static ?string $modelLabel = 'Lieferant';
|
||||
protected static ?string $slug = 'lieferant';
|
||||
protected static ?string $navigationGroup = 'CRM';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('name')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => Pages\ListSuppliers::route('/'),
|
||||
'create' => Pages\CreateSupplier::route('/create'),
|
||||
'edit' => Pages\EditSupplier::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
public static function getPluralLabel(): string
|
||||
{
|
||||
return 'Lieferanten';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user