Skip to content

Instantly share code, notes, and snippets.

View Alymosul's full-sized avatar

Aly Suleiman Alymosul

  • Berlin, Germany
View GitHub Profile
@Alymosul
Alymosul / README.md
Last active May 25, 2020 04:08
Downgrade PHP 7.2 to 7.1 on Laravel Forge

Install php7.1 related stuff..

apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \
php7.1-cli php7.1-dev \
php7.1-pgsql php7.1-sqlite3 php7.1-gd \
php7.1-curl php7.1-memcached \
php7.1-imap php7.1-mysql php7.1-mbstring \
php7.1-xml php7.1-zip php7.1-bcmath php7.1-soap \
php7.1-intl php7.1-readline php-xdebug php-pear php7.1-fpm
@Alymosul
Alymosul / README.md
Last active May 9, 2024 13:37
[Laravel] Seeding data in testing as part of the application build.

SeedDatabase trait along with SeedDatabaseState class gives your Laravel project the ability to seed the testing database once before running the full suite tests, which improves the speed of the tests than seeding the testing database before each test.

Also, it has the option to run custom seeders instead of the seeders that are called in the run() method of the DatabaseSeeder class you can achieve that as follows

...in the Testcase.php

public function setUp()

{

@Alymosul
Alymosul / Filterable.php
Last active February 16, 2023 07:04
Abstract Layer for Query Filters in Laravel
<?php
namespace App\Filters\Query;
trait Filterable
{
/**
* Apply Filters on the Eloquent Model
*
* @param $query