Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Integrated Laravel Package

laracasts/integrated

Laracasts Integrated is a Laravel package for using Vue components directly in Blade views. It provides a simple, elegant way to register and render Vue components, making it easy to add interactive frontend features to Laravel applications without cumbersome setup.

View on GitHub
Deep Wiki
Context7

Getting Started

laracasts/integrated is a test base class, not an application package. You install it as a dev dependency and extend it in your PHPUnit test cases; there is no facade, no artisan command, and in most versions no service provider to register.

composer require --dev laracasts/integrated

Read these three things, in this order:

  1. The GitHub README — it is the whole API surface in about fifty lines.
  2. src/Laracasts/Integrated/Extensions/Laravel.php — the class you will extend.
  3. The traits under Extensions/Traits — this is where visit, type, press, see, and friends actually live, and where you go when a method behaves differently than you expected.

The base class boots the Laravel application the same way Illuminate\Foundation\Testing\TestCase does, so createApplication() is already handled and your existing phpunit.xml keeps working. Your first useful test is a smoke test plus one form submission:

use Laracasts\Integrated\Extensions\Laravel as IntegrationTest;

class RegistrationTest extends IntegrationTest
{
    /** @test */
    public function it_registers_a_new_user()
    {
        $this->visit('/register')
             ->type('Jane Doe', 'name')
             ->type('[email protected]', 'email')
             ->type('secret', 'password')
             ->press('Register')
             ->see('Welcome, Jane');
    }
}

The alias matters. Importing it as plain Laravel collides with everything else and makes stack traces unreadable.

Implementation Patterns

Chain the flow, assert at the end. Every method returns $this, so a test reads as the user journey. Keep chains under roughly six calls; longer chains fail in ways that are hard to localize.

Use it for routes, not for logic. One smoke test per named route (visit('/pricing')->see('Pricing')) catches broken views and missing bindings cheaply. Leave business rules to unit tests.

Submit through forms, not through post(). The value of this package is that press('Register') finds the form in the last response, collects its action, method, and hidden inputs, and submits the recorded type() values. That is closer to real behavior than a hand-built payload, and it catches renamed fields.

Handle redirects explicitly.

$this->visit('/settings')
     ->type('[email protected]', 'email')
     ->press('Save')
     ->followRedirects()
     ->see('Settings updated');

Without followRedirects() you are asserting against the 302 body, which is usually empty.

Authenticate with be(). $this->be($user)->visit('/dashboard') sets the acting user for subsequent requests in the same test. Pair it with factories in setUp.

Compose a project base class. The fluent state is per-instance, so wrap repeated journeys:

abstract class IntegratedTestCase extends \Laracasts\Integrated\Extensions\Laravel
{
    protected function loginAs($user)
    {
        return $this->be($user)->visit('/login')
                    ->type($user->email, 'email')
                    ->type('secret', 'password')
                    ->press('Sign in');
    }
}

Mix with Laravel's own assertions freely. seeInDatabase, assertResponseStatus, and DatabaseTransactions all work alongside it; the chain is just sugar around $this->call().

For JSON endpoints, visit('/api/users')->seeJson(['id' => 1]) is fine, but once you need custom headers or raw bodies, drop to $this->call('POST', $uri, $data, [], [], $headers).

Gotchas and Tips

  • It is abandoned (last release June 2015). It targets the Laravel 5.0/5.1 and PHPUnit 4 era. Modern Composer will refuse to resolve it against PHP 8 or Laravel 9+; don't fight the constraints with --ignore-platform-reqs, because the underlying PHPUnit API changed and the tests will not run anyway. Use it only inside a legacy container, and treat every new test as migration debt.
  • There is a native replacement. Laravel 5.4+ feature tests ($this->get(), $this->post(), assertSee) cover the HTTP-level assertions, and Dusk covers the browser-level ones. If you are on anything newer than 5.1, port rather than install.
  • Form input state persists across visit() calls within a single test method. A type() left over from an earlier interaction can silently ride along on a later press(). If a submission looks wrong, start a fresh test or visit() the form page again before typing.
  • press() failures are almost always a text match. Check exact button text, surrounding whitespace, and which form is nearest in the DOM. Two buttons with the same label on one page will pick the wrong form.
  • see() matches rendered text, not markup. Escaped entities,  , and line-wrapped sentences break exact matches. Assert short, distinctive substrings.
  • Hidden inputs matter. _token, _method, and CSRF fields must be inside the form for press() to reconstruct the right request. Laravel's CSRF middleware bypasses during tests, but custom middleware does not — an unexpected 302 to /login means auth middleware, not a package bug.
  • A 500 looks like a failed text assertion. There is no withoutExceptionHandling() in this era. When a see() fails inexplicably, dump $this->response->getStatusCode() and $this->response->getContent() before touching the assertion.
  • No JavaScript execution at all. Anything rendered client-side is invisible. Don't try to assert on it.
  • Uploads need real files on disk, and the path is resolved from where PHPUnit runs, not from the test file. Use __DIR__ . '/fixtures/...'.
  • Extension point is the base class. Override createApplication() for non-standard bootstrapping, or add helper methods to a project-level abstract test case rather than patching the vendor code.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle