Skip to content

Commit 2893279

Browse files
committed
add webpack.mix.js and tests
1 parent 352ec16 commit 2893279

File tree

5 files changed

+101
-0
lines changed

5 files changed

+101
-0
lines changed

routes/channels.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Broadcast Channels
6+
|--------------------------------------------------------------------------
7+
|
8+
| Here you may register all of the event broadcasting channels that your
9+
| application supports. The given channel authorization callbacks are
10+
| used to check if an authenticated user can listen to the channel.
11+
|
12+
*/
13+
14+
Broadcast::channel('App.User.{id}', function ($user, $id) {
15+
return (int) $user->id === (int) $id;
16+
});

tests/CreatesApplication.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
use Illuminate\Contracts\Console\Kernel;
6+
7+
trait CreatesApplication
8+
{
9+
/**
10+
* Creates the application.
11+
*
12+
* @return \Illuminate\Foundation\Application
13+
*/
14+
public function createApplication()
15+
{
16+
$app = require __DIR__.'/../bootstrap/app.php';
17+
18+
$app->make(Kernel::class)->bootstrap();
19+
20+
return $app;
21+
}
22+
}

tests/Feature/ExampleTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Tests\Feature;
4+
5+
use Tests\TestCase;
6+
use Illuminate\Foundation\Testing\WithoutMiddleware;
7+
use Illuminate\Foundation\Testing\DatabaseMigrations;
8+
use Illuminate\Foundation\Testing\DatabaseTransactions;
9+
10+
class ExampleTest extends TestCase
11+
{
12+
/**
13+
* A basic test example.
14+
*
15+
* @return void
16+
*/
17+
public function testBasicTest()
18+
{
19+
$response = $this->get('/');
20+
21+
$response->assertStatus(200);
22+
}
23+
}

tests/Unit/ExampleTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Tests\Unit;
4+
5+
use Tests\TestCase;
6+
use Illuminate\Foundation\Testing\DatabaseMigrations;
7+
use Illuminate\Foundation\Testing\DatabaseTransactions;
8+
9+
class ExampleTest extends TestCase
10+
{
11+
/**
12+
* A basic test example.
13+
*
14+
* @return void
15+
*/
16+
public function testBasicTest()
17+
{
18+
$this->assertTrue(true);
19+
}
20+
}

webpack.mix.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { mix } = require('laravel-mix');
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Mix Asset Management
6+
|--------------------------------------------------------------------------
7+
|
8+
| Mix provides a clean, fluent API for defining some Webpack build steps
9+
| for your Laravel application. By default, we are compiling the Sass
10+
| file for the application as well as bundling up all the JS files.
11+
|
12+
*/
13+
14+
mix.js('resources/assets/js/app.js', 'public/js')
15+
.sass('resources/assets/sass/app.scss', 'public/css');
16+
17+
mix.browserSync({
18+
proxy: 'web:8000',
19+
open: false
20+
});

0 commit comments

Comments
 (0)