PHP code example of morrislaptop / laravel-boot-maker

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

    

morrislaptop / laravel-boot-maker example snippets




namespace Tests;

trait CreatesPartialApplication
{
    /**
     * Creates the application.
     *
     * @return \Illuminate\Foundation\Application
     */
    public function createApplication()
    {
        $app = 



namespace Tests;

use Morrislaptop\LaravelBootMaker\PartialTestCase as BasePartialTestCase;

abstract class PartialTestCase extends BasePartialTestCase
{
    use CreatesPartialApplication;
}



namespace Tests\Feature;

use App\Events\QuestionCreated;
use App\Listeners\AskQuestion;
use Illuminate\Support\Facades\Event;
use Morrislaptop\LaravelBootMaker\Concerns\Events;
use Tests\PartialTestCase;

class QuestionCreatedTest extends PartialTestCase
{
    use Events;

    /**
     * A basic feature test example.
     *
     * @return void
     */
    public function test_example()
    {
        Event::fake();
        Event::assertListening(QuestionCreated::class, AskQuestion::class);
    }
}

use Morrislaptop\LaravelBootMaker\Concerns\Auth;
use Morrislaptop\LaravelBootMaker\Concerns\Routes;
use Tests\PartialTestCase;

class ProfileTest extends PartialTestCase
{
    use Auth, Routes;

    public function test_it_shows_the_current_user()
    {
        $this->actingAs(new User(['name' => 'Bob']));

        $this->get('/me')->assertOk()->assertSee('Bob');
    }
}

abstract class PartialTestCase extends BasePartialTestCase
{
    use CreatesPartialApplication;

    protected function additionalProviders(): array
    {
        return [\Inertia\ServiceProvider::class];
    }
}

  protected function additionalProviders(): array
  {
      return [...parent::additionalProviders(), X::class];
  }
  

protected function consoleCommands(): array
{
    return [\App\Console\Commands\PruneProductTags::class];
}