<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ExportController;
use App\Http\Controllers\SettingsController;
use App\Http\Controllers\ActivityController;

Route::middleware('session.auth')->group(function () {
    Route::get('/exports/leads.csv', [ExportController::class, 'leads'])->middleware('permission:leads.export')->name('exports.leads');
    Route::get('/settings', [SettingsController::class, 'index'])->middleware('permission:settings.view')->name('settings.index');
    Route::post('/settings', [SettingsController::class, 'update'])->middleware('permission:settings.edit')->name('settings.update');
    Route::get('/leads/{lead}/activity', [ActivityController::class, 'lead'])->middleware('permission:leads.view')->name('leads.activity');
});
