F
Filament7mo ago
Kaan

Awcodes | Curator Image Upload Error

Hello. Whenever I try to upload and save an image on the create page, I get the following error:
SQLSTATE[HY000]: General error: 1 table media has no column named alt
INSERT INTO
"media" (
"alt",
"title",
"caption",
"description",
"disk",
"directory",
"visibility",
"name",
"path",
"exif",
"width",
"height",
"size",
"type",
"ext",
"updated_at",
"created_at"
)
VALUES
(
?,
ScreenShot,
?,
?,
public,
media,
public,
efb27e74 - b093 -4285 - 88c2 - 1876e2a2086a,
media / efb27e74 - b093 -4285 - 88c2 - 1876e2a2086a.jpg,
{ "FileName": ":-",
"FileDateTime": 1714334960,
"FileSize": 73685,
"FileType": 2,
"MimeType": "image\/jpeg",
"SectionsFound": "IFD0",
"COMPUTED": { "html": "width=\"813\" height=\"958\"",
"Height": 958,
"Width": 813,
"IsColor": 1,
"ByteOrderMotorola": 1 } },
813,
958,
73685,
image / jpeg,
jpg,
2024 -04 -28 20: 09: 22,
2024 -04 -28 20: 09: 22
)
SQLSTATE[HY000]: General error: 1 table media has no column named alt
INSERT INTO
"media" (
"alt",
"title",
"caption",
"description",
"disk",
"directory",
"visibility",
"name",
"path",
"exif",
"width",
"height",
"size",
"type",
"ext",
"updated_at",
"created_at"
)
VALUES
(
?,
ScreenShot,
?,
?,
public,
media,
public,
efb27e74 - b093 -4285 - 88c2 - 1876e2a2086a,
media / efb27e74 - b093 -4285 - 88c2 - 1876e2a2086a.jpg,
{ "FileName": ":-",
"FileDateTime": 1714334960,
"FileSize": 73685,
"FileType": 2,
"MimeType": "image\/jpeg",
"SectionsFound": "IFD0",
"COMPUTED": { "html": "width=\"813\" height=\"958\"",
"Height": 958,
"Width": 813,
"IsColor": 1,
"ByteOrderMotorola": 1 } },
813,
958,
73685,
image / jpeg,
jpg,
2024 -04 -28 20: 09: 22,
2024 -04 -28 20: 09: 22
)
Solution:
Yes, sorry my stupidity. 4 days ago I installed spatie's media librrary and they were in conflict 🙂
Jump to solution
8 Replies
Dennis Koch
Dennis Koch7mo ago
Did you just install or did you upgrade it? Because I just installed it today and there is an alt column.
Kaan
KaanOP7mo ago
I just installed
Dennis Koch
Dennis Koch7mo ago
What does you DB table look like?
Kaan
KaanOP7mo ago
<?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::create('media', function (Blueprint $table) {
$table->id();

$table->morphs('model');
$table->uuid()->nullable()->unique();
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('mime_type')->nullable();
$table->string('disk');
$table->string('conversions_disk')->nullable();
$table->unsignedBigInteger('size');
$table->json('manipulations');
$table->json('custom_properties');
$table->json('generated_conversions');
$table->json('responsive_images');
$table->unsignedInteger('order_column')->nullable()->index();

$table->nullableTimestamps();
});
}
};
<?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::create('media', function (Blueprint $table) {
$table->id();

$table->morphs('model');
$table->uuid()->nullable()->unique();
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('mime_type')->nullable();
$table->string('disk');
$table->string('conversions_disk')->nullable();
$table->unsignedBigInteger('size');
$table->json('manipulations');
$table->json('custom_properties');
$table->json('generated_conversions');
$table->json('responsive_images');
$table->unsignedInteger('order_column')->nullable()->index();

$table->nullableTimestamps();
});
}
};
<?php

use Awcodes\Curator\Facades\Curator;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
if(config('curator.is_tenant_aware')) {
Schema::table(app(config('curator.model'))->getTable(), function (Blueprint $table) {
$table->integer(config('curator.tenant_ownership_relationship_name') . '_id')->nullable();
});
}
}

public function down(): void
{
if (Schema::hasColumn(app(config('curator.model'))->getTable(), config('curator.tenant_ownership_relationship_name') . '_id')) {
Schema::table(app(config('curator.model'))->getTable(), function(Blueprint $table) {
$table->dropColumn(config('curator.tenant_ownership_relationship_name') . '_id');
});
}
}
};
<?php

use Awcodes\Curator\Facades\Curator;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
if(config('curator.is_tenant_aware')) {
Schema::table(app(config('curator.model'))->getTable(), function (Blueprint $table) {
$table->integer(config('curator.tenant_ownership_relationship_name') . '_id')->nullable();
});
}
}

public function down(): void
{
if (Schema::hasColumn(app(config('curator.model'))->getTable(), config('curator.tenant_ownership_relationship_name') . '_id')) {
Schema::table(app(config('curator.model'))->getTable(), function(Blueprint $table) {
$table->dropColumn(config('curator.tenant_ownership_relationship_name') . '_id');
});
}
}
};
I installed again but nothing to changed I'm writing this commands:
composer require awcodes/filament-curator
php artisan curator:install
npm install -D cropperjs
composer require awcodes/filament-curator
php artisan curator:install
npm install -D cropperjs
Dennis Koch
Dennis Koch7mo ago
GitHub
filament-curator/database/migrations/create_media_table.php.stub at...
A media picker plugin for Filament Panels. Contribute to awcodes/filament-curator development by creating an account on GitHub.
Dennis Koch
Dennis Koch7mo ago
It has alt column
Solution
Kaan
Kaan7mo ago
Yes, sorry my stupidity. 4 days ago I installed spatie's media librrary and they were in conflict 🙂
Kaan
KaanOP7mo ago
Thanks for helping!
Want results from more Discord servers?
Add your server