Skip to content

Instantly share code, notes, and snippets.

View brytey2k's full-sized avatar

Bright Nkrumah brytey2k

View GitHub Profile
@brytey2k
brytey2k / AppraisalService.php
Created July 9, 2025 12:34
Simple service to create google form like questions and store answers.
<?php
declare(strict_types=1);
namespace App\Services;
use App\Dto\Appraisal\CreateAppraisalFormResponseAnswerDto;
use App\Dto\Appraisal\CreateAppraisalFormResponseDto;
use App\Enums\StoragePath;
use App\Models\AppraisalFormQuestion;
@brytey2k
brytey2k / GenerateTenantIDEHelper.php
Created June 14, 2025 12:33
Simple work around for Laravel IDE Helper to generate field names of the various models in a multi-database multi-tenant application. The multi tenancy package used is https://github.com/archtechx/tenancy
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use App\Models\Tenant;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
@brytey2k
brytey2k / CreateGeneralExportFileJob.php
Last active February 11, 2025 19:32
A simple Laravel job that can help you export data through CSV from a database with millions of rows.
<?php
namespace App\Jobs;
use App\Models\GeneralExport;
use Storage;
class CreateGeneralExportFileJob implements ShouldQueue
{