2025-08-02 15:20:09 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Api\V1\ArticlesController;
|
|
|
|
|
use App\Http\Controllers\Api\V1\DashboardController;
|
|
|
|
|
use App\Http\Controllers\Api\V1\FeedsController;
|
|
|
|
|
use App\Http\Controllers\Api\V1\LogsController;
|
|
|
|
|
use App\Http\Controllers\Api\V1\PlatformAccountsController;
|
|
|
|
|
use App\Http\Controllers\Api\V1\PlatformChannelsController;
|
|
|
|
|
use App\Http\Controllers\Api\V1\RoutingController;
|
|
|
|
|
use App\Http\Controllers\Api\V1\SettingsController;
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| API Routes
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
| Here is where you can register API routes for your application. These
|
|
|
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
|
|
|
| be assigned to the "api" middleware group. Make something great!
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
Route::prefix('v1')->group(function () {
|
2025-08-07 21:19:19 +02:00
|
|
|
// All endpoints are public for demo purposes
|
2025-08-02 15:20:09 +02:00
|
|
|
// Route::middleware('auth:sanctum')->group(function () {
|
|
|
|
|
// Dashboard stats
|
|
|
|
|
Route::get('/dashboard/stats', [DashboardController::class, 'stats'])->name('api.dashboard.stats');
|
|
|
|
|
|
|
|
|
|
// Articles
|
|
|
|
|
Route::get('/articles', [ArticlesController::class, 'index'])->name('api.articles.index');
|
|
|
|
|
Route::post('/articles/{article}/approve', [ArticlesController::class, 'approve'])->name('api.articles.approve');
|
|
|
|
|
Route::post('/articles/{article}/reject', [ArticlesController::class, 'reject'])->name('api.articles.reject');
|
|
|
|
|
|
|
|
|
|
// Platform Accounts
|
|
|
|
|
Route::apiResource('platform-accounts', PlatformAccountsController::class)->names([
|
|
|
|
|
'index' => 'api.platform-accounts.index',
|
|
|
|
|
'store' => 'api.platform-accounts.store',
|
|
|
|
|
'show' => 'api.platform-accounts.show',
|
|
|
|
|
'update' => 'api.platform-accounts.update',
|
|
|
|
|
'destroy' => 'api.platform-accounts.destroy',
|
|
|
|
|
]);
|
|
|
|
|
Route::post('/platform-accounts/{platformAccount}/set-active', [PlatformAccountsController::class, 'setActive'])
|
|
|
|
|
->name('api.platform-accounts.set-active');
|
|
|
|
|
|
|
|
|
|
// Platform Channels
|
|
|
|
|
Route::apiResource('platform-channels', PlatformChannelsController::class)->names([
|
|
|
|
|
'index' => 'api.platform-channels.index',
|
|
|
|
|
'store' => 'api.platform-channels.store',
|
|
|
|
|
'show' => 'api.platform-channels.show',
|
|
|
|
|
'update' => 'api.platform-channels.update',
|
|
|
|
|
'destroy' => 'api.platform-channels.destroy',
|
|
|
|
|
]);
|
|
|
|
|
Route::post('/platform-channels/{channel}/toggle', [PlatformChannelsController::class, 'toggle'])
|
|
|
|
|
->name('api.platform-channels.toggle');
|
|
|
|
|
|
|
|
|
|
// Feeds
|
|
|
|
|
Route::apiResource('feeds', FeedsController::class)->names([
|
|
|
|
|
'index' => 'api.feeds.index',
|
|
|
|
|
'store' => 'api.feeds.store',
|
|
|
|
|
'show' => 'api.feeds.show',
|
|
|
|
|
'update' => 'api.feeds.update',
|
|
|
|
|
'destroy' => 'api.feeds.destroy',
|
|
|
|
|
]);
|
|
|
|
|
Route::post('/feeds/{feed}/toggle', [FeedsController::class, 'toggle'])->name('api.feeds.toggle');
|
|
|
|
|
|
|
|
|
|
// Routing
|
|
|
|
|
Route::get('/routing', [RoutingController::class, 'index'])->name('api.routing.index');
|
|
|
|
|
Route::post('/routing', [RoutingController::class, 'store'])->name('api.routing.store');
|
|
|
|
|
Route::get('/routing/{feed}/{channel}', [RoutingController::class, 'show'])->name('api.routing.show');
|
|
|
|
|
Route::put('/routing/{feed}/{channel}', [RoutingController::class, 'update'])->name('api.routing.update');
|
|
|
|
|
Route::delete('/routing/{feed}/{channel}', [RoutingController::class, 'destroy'])->name('api.routing.destroy');
|
|
|
|
|
Route::post('/routing/{feed}/{channel}/toggle', [RoutingController::class, 'toggle'])->name('api.routing.toggle');
|
|
|
|
|
|
|
|
|
|
// Settings
|
|
|
|
|
Route::get('/settings', [SettingsController::class, 'index'])->name('api.settings.index');
|
|
|
|
|
Route::put('/settings', [SettingsController::class, 'update'])->name('api.settings.update');
|
|
|
|
|
|
|
|
|
|
// Logs
|
|
|
|
|
Route::get('/logs', [LogsController::class, 'index'])->name('api.logs.index');
|
|
|
|
|
|
|
|
|
|
// Close the auth:sanctum middleware group when ready
|
|
|
|
|
// });
|
|
|
|
|
});
|