PHP code example of motty / laravel-common

1. Go to this page and download the library: Download motty/laravel-common 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/ */

    

motty / laravel-common example snippets


use Motty\Laravel\Common\Testing\Api;
use Motty\Laravel\Common\Testing\CleanDatabase;
use Motty\Laravel\Common\Testing\MigrateDatabase;
use Motty\Laravel\Common\Testing\ResetModelEvents;
use Motty\Laravel\Common\Testing\RelocateFactories;

class ApiTestCase extends TestCase
{
    use Api, CleanDatabase, MigrateDatabase, RelocateFactories, ResetModelEvents;
...


/**
 * @beforeClass
 */
public static function migrateDatabase()
{
    // migrate database according to our environment parameter MIGRATIONS_PATH
    Artisan::call('migrate', ['--path' => env('MIGRATIONS_PATH', 'database/migrations')]);
}

protected $models = [
    'Contact',
    'User'
];