Duplicate records as drafts, and preview them from the form
The copy keeps the content, stack and team, but is unpublished, out of any review, and gets a title marked as a copy and a free slug. It replaces Filament's replicate action, which left the copy without a slug and still published. The same copy is available through the API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ use App\Http\Controllers\Api\V1\BatchController;
|
||||
use App\Http\Controllers\Api\V1\CallController;
|
||||
use App\Http\Controllers\Api\V1\CategoryController;
|
||||
use App\Http\Controllers\Api\V1\ClientController;
|
||||
use App\Http\Controllers\Api\V1\DuplicateController;
|
||||
use App\Http\Controllers\Api\V1\HealthController;
|
||||
use App\Http\Controllers\Api\V1\MaintenanceController;
|
||||
use App\Http\Controllers\Api\V1\MeController;
|
||||
@@ -298,6 +299,10 @@ Route::prefix('v1')->name('api.v1.')->group(function () {
|
||||
Route::post("{$resource}/{{$parameter}}/preview", [PreviewController::class, 'store'])
|
||||
->defaults('content', $resource)
|
||||
->name("{$resource}.preview");
|
||||
|
||||
Route::post("{$resource}/{{$parameter}}/duplicate", [DuplicateController::class, 'store'])
|
||||
->defaults('content', $resource)
|
||||
->name("{$resource}.duplicate");
|
||||
}
|
||||
|
||||
// The library. A file is uploaded here and then referenced from a
|
||||
|
||||
Reference in New Issue
Block a user