diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index 804e77b..d118241 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -103,6 +103,7 @@ $search = $request->get('search'); $query->where(function ($q) use ($search) { $q->where('code', 'LIKE', "%$search%"); + $q->orWhere('symbol', 'LIKE', "%$search%"); $q->orWhere('name', 'LIKE', "%$search%"); }); } diff --git a/app/Http/Requests/CurrencyRequest.php b/app/Http/Requests/CurrencyRequest.php index 28236d3..247796a 100644 --- a/app/Http/Requests/CurrencyRequest.php +++ b/app/Http/Requests/CurrencyRequest.php @@ -14,6 +14,7 @@ { $rules = [ 'name' => 'required|string|max:255', + 'symbol' => 'required|string|max:10', 'decimal_places' => 'nullable|integer|between:0,3', 'status' => 'nullable|boolean', 'authorized_at' => 'nullable|datetime', diff --git a/app/Models/Currency.php b/app/Models/Currency.php index 864867c..b5099b9 100644 --- a/app/Models/Currency.php +++ b/app/Models/Currency.php @@ -9,6 +9,7 @@ protected $fillable = [ 'code', 'name', + 'symbol', 'decimal_places', 'status', 'authorized_at', diff --git a/database/migrations/2024_08_12_024448_create_currencies_table.php b/database/migrations/2024_08_12_024448_create_currencies_table.php index ec92b59..1b740f4 100644 --- a/database/migrations/2024_08_12_024448_create_currencies_table.php +++ b/database/migrations/2024_08_12_024448_create_currencies_table.php @@ -15,6 +15,7 @@ $table->id(); $table->string('code', 3)->unique(); $table->string('name'); + $table->string('symbol')->nullable(); $table->integer('decimal_places')->default(2); $table->boolean('status')->default(true)->nullable(); $table->timestamps(); diff --git a/resources/views/currency/create.blade.php b/resources/views/currency/create.blade.php index c8b8f03..5b1c3e8 100644 --- a/resources/views/currency/create.blade.php +++ b/resources/views/currency/create.blade.php @@ -46,6 +46,17 @@ @enderror +