Skip to content

Commit 3de1205

Browse files
author
LDFOUR\luisd
committed
WN-252,
I set the length for the contributors column. For the logo column, I set the length to 2048 to store signed URLs.
1 parent 4b94ebe commit 3de1205

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

app/Classes/Repositories/OrganisationRepository.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ public function updateDetailsWithInput(Organisation $org, array $input)
108108
'logo' => $contributor['logo'],
109109
]);
110110

111-
$contributor->validate($contributor->toArray());
111+
$isValid = $contributor->validate($contributor->toArray());
112+
113+
if (!$isValid) {
114+
Log::error('Contributor validation failed', ['errors' => $contributor->errors()->toArray()]);
115+
}
112116

113117
$currentDetail->contributors()->save($contributor);
114118
}

app/Models/Contributor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class Contributor extends Model
3838
*/
3939
protected $rules = [
4040
'name' => 'required|string|between:2,100',
41-
'logo' => 'string|between:2,100',
42-
'org_detail_id' => 'required|integer',
41+
'logo' => 'string|between:2,2048',
4342
];
4443

4544

database/migrations/2025_02_18_165714_create_contributors_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public function up()
1616
Schema::dropIfExists('contributors');
1717
Schema::create('contributors', function (Blueprint $table) {
1818
$table->increments('id');
19-
$table->text('name');
20-
$table->text('logo');
19+
$table->string('name', 100);
20+
$table->string('logo', 2048)->nullable();
2121
$table->integer('org_detail_id')->unsigned();
2222
$table->foreign('org_detail_id')->references('id')->on('organisation_details')->onDelete('cascade');
2323
});

0 commit comments

Comments
 (0)