<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'announcement', 'as' => 'announcement.', 'namespace' => 'Announcements'], function () {
    Route::get('/list', 'ListAnnouncementsController@list')->name('list');
    Route::post('/create', 'CreateAnnouncementController@create')->name('create');
    Route::put('/update/{id}', 'UpdateAnnouncementController@update')->name('update');    
    Route::delete('/delete/{id}', 'DeleteAnnouncementController@delete')->name('delete');
    
    Route::group(['prefix' => '{id}/segment', 'as' => 'segment.'], function () {
        Route::post('/assign', 'AssignAnnouncementToSegmentController@assign')->name('assign');
        Route::delete('/detach/{segment_id}', 'RemoveSegmentFromAnnouncementController@detach')->name('detach');
    });
});