1. Go to this page and download the library: Download vexor/framework 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/ */
class SendEmailsCommand extends Command
{
public function getName(): string { return 'emails:send'; }
public function getDescription(): string { return 'Send pending emails'; }
public function execute(Input $input, Console $console): int
{
$limit = $input->option('limit', 100);
$this->info("Sending up to {$limit} emails...");
// İş mantığı burada
$this->success('Done!');
return 0;
}
}
class RoleMiddleware implements MiddlewareInterface
{
public function handle(Request $request, Closure $next): Response
{
$user = $request->getAttribute('user');
if (!$user?->isAdmin()) {
return Response::json(['error' => 'Forbidden'], 403);
}
return $next($request);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.