- Added standard Laravel directory structure and configuration. - Included Svelte and Tailwind configuration for the admin interface. - Added core PHPUnit and testing scripts.
31 lines
897 B
PHP
31 lines
897 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin\Content;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\CustomField;
|
|
use App\Models\CustomPostType;
|
|
use App\Services\ContentModelerService;
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
/**
|
|
* Controller for deleting a custom field.
|
|
*/
|
|
class CustomFieldDestroyController extends Controller
|
|
{
|
|
/**
|
|
* Remove the specified custom field.
|
|
*
|
|
* @param \App\Models\CustomPostType $customPostType
|
|
* @param \App\Models\CustomField $customField
|
|
* @param \App\Services\ContentModelerService $service
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
*/
|
|
public function __invoke(CustomPostType $customPostType, CustomField $customField, ContentModelerService $service): RedirectResponse
|
|
{
|
|
$service->deleteCustomField($customField);
|
|
|
|
return redirect()->back()->with('success', 'Custom field deleted.');
|
|
}
|
|
}
|