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:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\InvoiceSettings;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -53,4 +54,35 @@ class InvoiceSettingsController extends Controller
|
||||
return redirect()->route('invoice-settings.edit')
|
||||
->with('success', '🧾 Invoice settings saved!');
|
||||
}
|
||||
|
||||
public function uploadLogo(Request $request): JsonResponse
|
||||
{
|
||||
$request->validate(['header_logo' => 'required|image|max:2048']);
|
||||
|
||||
$settings = InvoiceSettings::instance();
|
||||
|
||||
if ($settings->header_logo) {
|
||||
Storage::disk('public')->delete($settings->header_logo);
|
||||
}
|
||||
|
||||
$path = $request->file('header_logo')->store('invoice-logos', 'public');
|
||||
$settings->update(['header_logo' => $path]);
|
||||
|
||||
return response()->json([
|
||||
'url' => asset('storage/' . $path),
|
||||
]);
|
||||
}
|
||||
|
||||
public function deleteLogo(): RedirectResponse
|
||||
{
|
||||
$settings = InvoiceSettings::instance();
|
||||
|
||||
if ($settings->header_logo) {
|
||||
Storage::disk('public')->delete($settings->header_logo);
|
||||
$settings->update(['header_logo' => null]);
|
||||
}
|
||||
|
||||
return redirect()->route('invoice-settings.edit')
|
||||
->with('success', '🗑️ Logo removed.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user