1. Go to this page and download the library: Download metalinked/laravel-defender library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
'alerts' => [
'channels' => [
'log', // Always enabled by default
'database', // Enabled to save to the database
// 'mail', // Enable to receive email alerts
// 'slack', // Enable to receive Slack alerts
// 'webhook' // Enable to receive alerts via webhook
],
'mail' => [
'to' => env('DEFENDER_ALERT_MAIL_TO', null),
],
'slack' => [
'webhook_url' => env('DEFENDER_SLACK_WEBHOOK', null),
],
'webhook' => [
'url' => env('DEFENDER_ALERT_WEBHOOK', null),
],
],
'ip_logging' => [
'log_all' => false, // WARNING: If true, logs ALL requests (not just suspicious ones).
// Only recommended for testing or temporary auditing.
// Not suitable for production environments!
],
'brute_force' => [
'max_attempts' => 5,
'decay_minutes' => 10,
],
use Illuminate\Support\Facades\Schedule;
Schedule::command('defender:prune-logs --days=90')->daily();
protected function schedule(Schedule $schedule)
{
$schedule->command('defender:prune-logs --days=90')->daily();
}