<?php
/**
 * Route Additions for Newsletter Module — Gmind Institute
 *
 * ADD these route lines to your existing routes/web.php file.
 * Do NOT replace the entire file — just add these lines.
 */

// ─── Newsletter (Public) ─────────────────────────────────────────────────────
// Add these AFTER the existing public routes (e.g., after the Demo Class route)

$router->post('/newsletter/subscribe', 'NewsletterController@subscribe');
$router->get('/newsletter/unsubscribe', 'NewsletterController@unsubscribe');

// ─── Admin — Newsletter ──────────────────────────────────────────────────────
// Add these AFTER the existing admin routes (e.g., before the "Return the router" line)

$router->get('/admin/newsletter', 'Admin\Controllers\AdminNewsletterController@index', ['auth', 'admin']);
$router->post('/admin/newsletter/{id}/toggle-status', 'Admin\Controllers\AdminNewsletterController@toggleStatus', ['auth', 'admin']);
$router->post('/admin/newsletter/{id}/delete', 'Admin\Controllers\AdminNewsletterController@delete', ['auth', 'admin']);
$router->get('/admin/newsletter/compose', 'Admin\Controllers\AdminNewsletterController@compose', ['auth', 'admin']);
$router->post('/admin/newsletter/send', 'Admin\Controllers\AdminNewsletterController@send', ['auth', 'admin']);
$router->get('/admin/newsletter/logs', 'Admin\Controllers\AdminNewsletterController@logs', ['auth', 'admin']);
