feat: add notes management feature with CRUD operations
- Created Note model and controller for handling notes. - Added routes for notes CRUD operations. - Implemented notes index view with search and pinning functionality. - Created migration for notes table with necessary fields. - Developed event creation form with client and contract options.
This commit is contained in:
@@ -41,6 +41,11 @@ class MediaFile extends Model
|
||||
return str_starts_with($this->mime_type, 'image/');
|
||||
}
|
||||
|
||||
public function getIsVideoAttribute(): bool
|
||||
{
|
||||
return str_starts_with($this->mime_type, 'video/');
|
||||
}
|
||||
|
||||
public function getIconAttribute(): string
|
||||
{
|
||||
if ($this->is_image) return '🖼️';
|
||||
|
||||
22
app/Models/Note.php
Normal file
22
app/Models/Note.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Note extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'content',
|
||||
'color',
|
||||
'is_pinned',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'content' => 'array',
|
||||
'is_pinned' => 'boolean',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user