Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Dendi Handian
Dendi Handian

Posted on

     

Testing Laravel Breeze Authentication

Laravel Breeze is a new and surprising laravel package developed by Taylor Otwell himself and released just a few days ago.

Surprise package release. When? Now! Laravel Breeze. If Jetstream overwhelmed you and you need something simpler for now. Blade + Tailwind only. Every route and controller exported directly to your application. Same beautiful Jetstream style UI.https://t.co/V3QMrVzY0p 🌴🌊🌴

— Taylor Otwell 🛸 (@taylorotwell)November 9, 2020

What this package provides is the more low-level auth scaffolding UI using Tailwind and AlpineJS, which the oldlaravel-ui auth scaffolding is using either Bootstrap, Vue or React.

Installing the package

The best way to try this package is by using a new and freshly created laravel app and installing the package using:

composer require laravel/breeze --dev
Enter fullscreen modeExit fullscreen mode

and then scaffold the auth feature using

php artisan breeze:install
Enter fullscreen modeExit fullscreen mode

and then also make sure to build the assets by:

npm installnpm run dev```and then the login and register are ready to use.![laravel breeze login page](https://dev-to-uploads.s3.amazonaws.com/i/xyz3xjmc8l3140lhvy5v.png)![laravel breeze register page](https://dev-to-uploads.s3.amazonaws.com/i/an82apkiup1onvm9tpjb.png)![laravel breeze dashboard page](https://dev-to-uploads.s3.amazonaws.com/i/zgwhmvws4niarey471y2.png)## Testing the packageMy plan for this post is to make some `feature/unit tests` to test the login and register functionality as well as improving my `PHPUnit` testing skill. But `laravel/breeze` already provides all the test suites for us. <blockquote><p lang="en" dir="ltr">Breeze even exports a set of nice tests to your application... ✅ <a href="https://t.co/zxf9eVzLJu">pic.twitter.com/zxf9eVzLJu</a></p>&mdash; Taylor Otwell 🛸 (@taylorotwell) <a href="https://twitter.com/taylorotwell/status/1325891538279428097?ref_src=twsrc%5Etfw">November 9, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>So, I will learn from it instead.To enable and try the `phpunit`, you can see in `phpunit.xml` file and uncomment these lines:```xml...        <server name="DB_CONNECTION" value="sqlite"/>        <server name="DB_DATABASE" value=":memory:"/>...```and then you can run all tests using:```php artisan test```Laravel Breeze is a great starting point for your laravel project if you are already comfortable using Tailwind and the purge configuration is already set to use if you build your assets for production (`npm run prod`).Have fun exploring this package.
Enter fullscreen modeExit fullscreen mode

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Data Engineer - Building Data Lake & Modern Data Architecture
  • Location
    Jakarta
  • Education
    B.S. Computer Science
  • Work
    Data Engineer at Media Production Company
  • Joined

More fromDendi Handian

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp