I have a Laravel store script. I wrote a plugin for this script that makes a backup from the database. I have routed it with the following command:
Route::get('/backupsfiles/cronbackup', [BackupFilesController::class,'cronbackup'])->name('backupsfiles.cronbackup');
And I have created a cron job with the following command in cPanel:
wget -O - http://subdomain.domain.com/backupsfiles/cronbackup
If I execute this command from the terminal environment of my computer that has Linux operating system, this script will be executed. But the problem is that I want this script to be executed only from my cPanel host and no one else can execute it from another Linux terminal. In addition, there are other functions in the BackupFilesController file that even guest users can use without logging in. For example, if a backup file has been shared, they can download it without logging in. Is there a solution? thanks in advance