Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
c5b0a43928
commit
a4f3254ebd
3 files changed
+51
-1
No files matched your search
@@ -28,8 +28,24 @@ class SupplierResource extends Resource
|
|||||||
return $form
|
return $form
|
||||||
->schema([
|
->schema([
|
||||||
Forms\Components\TextInput::make('name')
|
Forms\Components\TextInput::make('name')
|
||||||
|
->label('Name')
|
||||||
->required()
|
->required()
|
||||||
->maxLength(255),
|
->maxLength(255),
|
||||||
|
Forms\Components\TextInput::make('address')
|
||||||
|
->label('Anschrift')
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\TextInput::make('phone')
|
||||||
|
->label('Telefon')
|
||||||
|
->tel()
|
||||||
|
->maxLength(50),
|
||||||
|
Forms\Components\TextInput::make('email')
|
||||||
|
->label('E-Mail')
|
||||||
|
->email()
|
||||||
|
->maxLength(255),
|
||||||
|
Forms\Components\TextInput::make('website')
|
||||||
|
->label('Webseite')
|
||||||
|
->url()
|
||||||
|
->maxLength(255),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +54,16 @@ class SupplierResource extends Resource
|
|||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('name')
|
Tables\Columns\TextColumn::make('name')
|
||||||
|
->label('Name')
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
Tables\Columns\TextColumn::make('email')
|
||||||
|
->label('E-Mail')
|
||||||
|
->searchable(),
|
||||||
|
Tables\Columns\TextColumn::make('phone')
|
||||||
|
->label('Telefon'),
|
||||||
|
Tables\Columns\TextColumn::make('website')
|
||||||
|
->label('Webseite')
|
||||||
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class Supplier extends Model
|
class Supplier extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
protected $fillable = ['name'];
|
protected $fillable = ['name', 'address', 'phone', 'email', 'website'];
|
||||||
|
|
||||||
public function spiceSuppliers()
|
public function spiceSuppliers()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('suppliers', function (Blueprint $table) {
|
||||||
|
$table->string('address')->nullable()->after('name');
|
||||||
|
$table->string('phone')->nullable()->after('address');
|
||||||
|
$table->string('email')->nullable()->after('phone');
|
||||||
|
$table->string('website')->nullable()->after('email');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('suppliers', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['address', 'phone', 'email', 'website']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in new issue
Block a user