1. Go to this page and download the library: Download tonysm/tailwindcss-laravel 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/ */
namespace Tests;
use Exception;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Tonysm\TailwindCss\Testing\InteractsWithTailwind;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
use InteractsWithTailwind;
protected function setUp(): void
{
parent::setUp();
$this->withoutTailwind();
}
}
namespace Tests;
use Exception;
use Tests\TestCase;
use Tonysm\TailwindCss\Testing\InteractsWithTailwind;
class ExampleTest extends TestCase
{
use InteractsWithTailwind;
/** @test */
public function throws_exception_when_manifest_is_missing()
{
$this->expectException(Exception::class);
$this->withoutExceptionHandling()
->get(route('login'));
$this->fail('Expected exception to be thrown, but it did not.');
}
/** @test */
public function can_disable_tailwindcss_exception()
{
$this->withoutTailwind()
->get(route('login'))
->assertOk();
}
}