up
This commit is contained in:
@@ -39,8 +39,7 @@ class TelaResource extends Resource
|
||||
->required()
|
||||
->helperText('Ej: Algodón, Poliéster, Denim'),
|
||||
|
||||
FileUpload::make('foto')->image()->directory('telas')->disk('public')->visibility('public')->maxSize(1024)->imageEditor()->imageEditorAspectRatios(['16:9','4:3','1:1'])->helperText('Selecciona una imagen de la tela (máx. 1MB)')->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])->downloadable()->openable()->nullable()
|
||||
,
|
||||
|
||||
|
||||
ColorPicker::make('color')->default('#000000'),
|
||||
|
||||
@@ -87,7 +86,7 @@ class TelaResource extends Resource
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\ImageColumn::make('foto')->disk('public'),
|
||||
|
||||
Tables\Columns\TextColumn::make('codigo')->searchable(),
|
||||
Tables\Columns\TextColumn::make('tipo')->searchable(),
|
||||
Tables\Columns\TextColumn::make('color')->searchable(),
|
||||
|
||||
@@ -9,7 +9,6 @@ class Tela extends Model
|
||||
protected $fillable = [
|
||||
'codigo',
|
||||
'tipo',
|
||||
'foto',
|
||||
'color',
|
||||
'proveedor_id',
|
||||
'metros_comprados',
|
||||
@@ -21,7 +20,6 @@ class Tela extends Model
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'foto' => 'string',
|
||||
'valor_total' => 'decimal:2',
|
||||
'costo_por_metro' => 'decimal:2',
|
||||
];
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('telas', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('telas', 'foto')) {
|
||||
$table->dropColumn('foto');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('telas', function (Blueprint $table) {
|
||||
if (! Schema::hasColumn('telas', 'foto')) {
|
||||
$table->string('foto')->nullable()->after('tipo');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user