├── .DS_Store
├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── .styleci.yml
├── README.md
├── Untitled.php
├── app
├── Car.php
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── Auth
│ │ │ ├── EmailVerificationController.php
│ │ │ ├── LogoutController.php
│ │ │ └── PasswordResetController.php
│ │ └── Controller.php
│ ├── Kernel.php
│ ├── Livewire
│ │ ├── ActionsDemoTable.php
│ │ ├── Auth
│ │ │ ├── Login.php
│ │ │ ├── Passwords
│ │ │ │ ├── Confirm.php
│ │ │ │ ├── Email.php
│ │ │ │ └── Reset.php
│ │ │ ├── Register.php
│ │ │ └── Verify.php
│ │ ├── ComplexDemoTable.php
│ │ ├── DatatableOfContents.php
│ │ ├── DeletableDemoTable.php
│ │ ├── RelationDemoTable.php
│ │ └── RestoreAll.php
│ └── Middleware
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustHosts.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
├── Page.php
├── Planet.php
├── Post.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Region.php
├── User.php
└── Weapon.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── cors.php
├── database.php
├── filesystems.php
├── hashing.php
├── ignition.php
├── livewire-datatables.php
├── livewire.php
├── logging.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ ├── CarFactory.php
│ ├── PostFactory.php
│ ├── UserFactory.php
│ └── WeaponFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ ├── 2020_06_24_110922_create_weapons_table.php
│ ├── 2020_06_24_111709_create_user_weapon_table.php
│ ├── 2020_06_28_005157_create_planets_table.php
│ ├── 2020_06_28_155531_create_pages_table.php
│ ├── 2020_07_27_232421_create_regions_table.php
│ ├── 2020_07_30_140508_create_cars_table.php
│ └── 2020_07_30_144348_create_posts_table.php
└── seeds
│ ├── CarSeeder.php
│ ├── DatabaseSeeder.php
│ ├── PageSeeder.php
│ ├── PlanetSeeder.php
│ ├── RegionSeeder.php
│ ├── UserSeeder.php
│ └── WeaponSeeder.php
├── package-lock.json
├── package.json
├── phpunit.xml
├── public
├── .DS_Store
├── .htaccess
├── MOS_favicon.png
├── css
│ ├── app.css
│ ├── app.css.map
│ └── prism.css
├── favicon.ico
├── images
│ └── mos.svg
├── index.php
├── js
│ ├── app.js
│ ├── app.js.map
│ └── prism.js
├── mix-manifest.json
└── robots.txt
├── resources
├── .DS_Store
├── js
│ └── app.js
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
├── sass
│ ├── .DS_Store
│ └── app.scss
└── views
│ ├── .DS_Store
│ ├── actions.blade.php
│ ├── auth
│ ├── login.blade.php
│ ├── passwords
│ │ ├── confirm.blade.php
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ ├── register.blade.php
│ └── verify.blade.php
│ ├── complex.blade.php
│ ├── components
│ ├── code.blade.php
│ ├── email.blade.php
│ ├── github.blade.php
│ ├── logo.blade.php
│ ├── modal.blade.php
│ ├── mos.blade.php
│ └── selected.blade.php
│ ├── deletable.blade.php
│ ├── home.blade.php
│ ├── icons
│ ├── arrow-left.blade.php
│ ├── arrow-right.blade.php
│ ├── check-circle.blade.php
│ ├── chevron-down.blade.php
│ ├── chevron-up.blade.php
│ ├── cog.blade.php
│ └── x-circle.blade.php
│ ├── intermediate.blade.php
│ ├── layouts
│ ├── app.blade.php
│ ├── auth.blade.php
│ └── base.blade.php
│ ├── livewire
│ ├── auth
│ │ ├── login.blade.php
│ │ ├── passwords
│ │ │ ├── confirm.blade.php
│ │ │ ├── email.blade.php
│ │ │ └── reset.blade.php
│ │ ├── register.blade.php
│ │ └── verify.blade.php
│ └── datatables
│ │ ├── boolean.blade.php
│ │ ├── checkbox.blade.php
│ │ ├── complex-query-group.blade.php
│ │ ├── complex-query-rule.blade.php
│ │ ├── complex-query.blade.php
│ │ ├── datatable.blade.php
│ │ ├── delete.blade.php
│ │ ├── editable.blade.php
│ │ ├── filters
│ │ ├── boolean.blade.php
│ │ ├── date.blade.php
│ │ ├── editable.blade.php
│ │ ├── number.blade.php
│ │ ├── select.blade.php
│ │ ├── string.blade.php
│ │ └── time.blade.php
│ │ ├── header-inline-hide.blade.php
│ │ ├── header-no-hide.blade.php
│ │ ├── hide-column-multiselect.blade.php
│ │ ├── highlight.blade.php
│ │ ├── icons
│ │ ├── arrow-circle-left.blade.php
│ │ ├── arrow-left.blade.php
│ │ ├── arrow-right.blade.php
│ │ ├── check-circle.blade.php
│ │ ├── chevron-down.blade.php
│ │ ├── chevron-up.blade.php
│ │ ├── cog.blade.php
│ │ ├── copy.blade.php
│ │ ├── excel.blade.php
│ │ ├── trash.blade.php
│ │ └── x-circle.blade.php
│ │ ├── link.blade.php
│ │ ├── tailwind-pagination.blade.php
│ │ ├── tailwind-simple-pagination.blade.php
│ │ └── tooltip.blade.php
│ ├── relation.blade.php
│ ├── show-email.blade.php
│ ├── simple.blade.php
│ └── table-actions.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── server.php
├── storage
├── .DS_Store
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── debugbar
│ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ ├── .gitignore
│ │ └── data
│ │ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tailwind.config.js
├── tests
├── CreatesApplication.php
├── Feature
│ ├── Auth
│ │ ├── LoginTest.php
│ │ ├── LogoutTest.php
│ │ ├── Passwords
│ │ │ ├── ConfirmTest.php
│ │ │ ├── EmailTest.php
│ │ │ └── ResetTest.php
│ │ ├── RegisterTest.php
│ │ └── VerifyTest.php
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
├── vapor.yml
└── webpack.mix.js
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/.DS_Store
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=LivewireDatatables
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 |
9 | DB_CONNECTION=mysql
10 | DB_HOST=127.0.0.1
11 | DB_PORT=3306
12 | DB_DATABASE=
13 | DB_USERNAME=root
14 | DB_PASSWORD=
15 |
16 | BROADCAST_DRIVER=log
17 | CACHE_DRIVER=file
18 | QUEUE_CONNECTION=sync
19 | SESSION_DRIVER=file
20 | SESSION_LIFETIME=120
21 |
22 | REDIS_HOST=127.0.0.1
23 | REDIS_PASSWORD=null
24 | REDIS_PORT=6379
25 |
26 | MAIL_MAILER=smtp
27 | MAIL_HOST=smtp.mailtrap.io
28 | MAIL_PORT=2525
29 | MAIL_USERNAME=null
30 | MAIL_PASSWORD=null
31 | MAIL_ENCRYPTION=null
32 | MAIL_FROM_ADDRESS=null
33 | MAIL_FROM_NAME="${APP_NAME}"
34 |
35 | AWS_ACCESS_KEY_ID=
36 | AWS_SECRET_ACCESS_KEY=
37 | AWS_DEFAULT_REGION=us-east-1
38 | AWS_BUCKET=
39 |
40 | PUSHER_APP_ID=
41 | PUSHER_APP_KEY=
42 | PUSHER_APP_SECRET=
43 | PUSHER_APP_CLUSTER=mt1
44 |
45 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
46 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
47 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | .env
7 | .env.backup
8 | .phpunit.result.cache
9 | Homestead.json
10 | Homestead.yaml
11 | npm-debug.log
12 | yarn-error.log
13 | .vapor/
14 | .env.production
15 | .env.staging
16 |
--------------------------------------------------------------------------------
/.styleci.yml:
--------------------------------------------------------------------------------
1 | php:
2 | preset: laravel
3 | disabled:
4 | - unused_use
5 | finder:
6 | not-name:
7 | - index.php
8 | - server.php
9 | js:
10 | finder:
11 | not-name:
12 | - webpack.mix.js
13 | css: true
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Livewire Datatables
2 |
3 | ## [Live Demo](https://livewire-datatables.com)
4 |
5 | ## Demo Laravel app for [Livewire Datatables](https://github.com/mediconesystems/livewire-datatables)
6 |
7 | ### Installation
8 | - Clone the repo
9 |
10 | ```bash
11 | git clone https://github.com/MedicOneSystems/demo-livewire-datatables.git
12 | cd demo-livewire-datatables
13 | ```
14 |
15 | - Install composer dependencies
16 | ```bash
17 | composer install
18 | ```
19 |
20 | - Create your .env and populate database credentials
21 | ```bash
22 | cp .env.example .env
23 | ```
24 |
25 | - Generate App key
26 | ```bash
27 | php artisan key
28 |
29 | - Migrate and seed the database
30 | ```bash
31 | php artisan migrate --seed
32 | ```
33 |
34 | For full docs see the [Livewire Datatables](https://github.com/mediconesystems/livewire-datatables) repo.
35 |
--------------------------------------------------------------------------------
/app/Car.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')->hourly();
28 | }
29 |
30 | /**
31 | * Register the commands for the application.
32 | *
33 | * @return void
34 | */
35 | protected function commands()
36 | {
37 | $this->load(__DIR__.'/Commands');
38 |
39 | require base_path('routes/console.php');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | getKey())) {
17 | throw new AuthorizationException();
18 | }
19 |
20 | if (!hash_equals((string) $hash, sha1(Auth::user()->getEmailForVerification()))) {
21 | throw new AuthorizationException();
22 | }
23 |
24 | if (Auth::user()->hasVerifiedEmail()) {
25 | return redirect(route('home'));
26 | }
27 |
28 | if (Auth::user()->markEmailAsVerified()) {
29 | event(new Verified(Auth::user()));
30 | }
31 |
32 | return redirect(route('home'));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/LogoutController.php:
--------------------------------------------------------------------------------
1 | $token,
13 | ]);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
38 | \App\Http\Middleware\VerifyCsrfToken::class,
39 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
40 | ],
41 |
42 | 'api' => [
43 | 'throttle:60,1',
44 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
45 | ],
46 | ];
47 |
48 | /**
49 | * The application's route middleware.
50 | *
51 | * These middleware may be assigned to groups or used individually.
52 | *
53 | * @var array
54 | */
55 | protected $routeMiddleware = [
56 | 'auth' => \App\Http\Middleware\Authenticate::class,
57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
58 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
63 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
66 | ];
67 | }
68 |
--------------------------------------------------------------------------------
/app/Http/Livewire/ActionsDemoTable.php:
--------------------------------------------------------------------------------
1 | filterable(),
19 |
20 | Column::name('name')->filterable()->searchable(),
21 |
22 | Column::name('email')->truncate()->filterable()->searchable(),
23 |
24 | DateColumn::name('created_at')->filterable(),
25 |
26 | Column::callback(['id', 'name'], function ($id, $name) {
27 | return view('table-actions', ['id' => $id, 'name' => $name]);
28 | })->unsortable()
29 | ];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Auth/Login.php:
--------------------------------------------------------------------------------
1 | validate([
23 | 'email' => ['required', 'email'],
24 | 'password' => ['required'],
25 | ]);
26 |
27 | if (!Auth::attempt($credentials, $this->remember)) {
28 | $this->addError('email', trans('auth.failed'));
29 |
30 | return;
31 | }
32 |
33 | redirect(route('home'));
34 | }
35 |
36 | public function render()
37 | {
38 | return view('livewire.auth.login');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Auth/Passwords/Confirm.php:
--------------------------------------------------------------------------------
1 | validate([
15 | 'password' => 'required|password',
16 | ]);
17 |
18 | session()->put('auth.password_confirmed_at', time());
19 |
20 | redirect()->intended(route('home'));
21 | }
22 |
23 | public function render()
24 | {
25 | return view('livewire.auth.passwords.confirm');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Auth/Passwords/Email.php:
--------------------------------------------------------------------------------
1 | validate([
19 | 'email' => ['required', 'email'],
20 | ]);
21 |
22 | $response = $this->broker()->sendResetLink(['email' => $this->email]);
23 |
24 | if ($response == Password::RESET_LINK_SENT) {
25 | $this->emailSentMessage = trans($response);
26 |
27 | return;
28 | }
29 |
30 | $this->addError('email', trans($response));
31 | }
32 |
33 | /**
34 | * Get the broker to be used during password reset.
35 | *
36 | * @return \Illuminate\Contracts\Auth\PasswordBroker
37 | */
38 | public function broker()
39 | {
40 | return Password::broker();
41 | }
42 |
43 | public function render()
44 | {
45 | return view('livewire.auth.passwords.email');
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Auth/Passwords/Reset.php:
--------------------------------------------------------------------------------
1 | token = $token;
30 | }
31 |
32 | public function resetPassword()
33 | {
34 | $this->validate([
35 | 'token' => 'required',
36 | 'email' => 'required|email',
37 | 'password' => 'required|min:8|same:passwordConfirmation',
38 | ]);
39 |
40 | $response = $this->broker()->reset(
41 | [
42 | 'token' => $this->token,
43 | 'email' => $this->email,
44 | 'password' => $this->password
45 | ],
46 | function ($user, $password) {
47 | $user->password = Hash::make($password);
48 |
49 | $user->setRememberToken(Str::random(60));
50 |
51 | $user->save();
52 |
53 | event(new PasswordReset($user));
54 |
55 | $this->guard()->login($user);
56 | }
57 | );
58 |
59 | if ($response == Password::PASSWORD_RESET) {
60 | session()->flash(trans($response));
61 |
62 | return redirect(route('home'));
63 | }
64 |
65 | $this->addError('email', trans($response));
66 | }
67 |
68 | /**
69 | * Get the broker to be used during password reset.
70 | *
71 | * @return \Illuminate\Contracts\Auth\PasswordBroker
72 | */
73 | public function broker()
74 | {
75 | return Password::broker();
76 | }
77 |
78 | /**
79 | * Get the guard to be used during password reset.
80 | *
81 | * @return \Illuminate\Contracts\Auth\StatefulGuard
82 | */
83 | protected function guard()
84 | {
85 | return Auth::guard();
86 | }
87 |
88 | public function render()
89 | {
90 | return view('livewire.auth.passwords.reset');
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Auth/Register.php:
--------------------------------------------------------------------------------
1 | validate([
28 | 'name' => ['required'],
29 | 'email' => ['required', 'email', 'unique:users'],
30 | 'password' => ['required', 'min:8', 'same:passwordConfirmation'],
31 | ]);
32 |
33 | $user = User::create([
34 | 'email' => $this->email,
35 | 'name' => $this->name,
36 | 'password' => Hash::make($this->password),
37 | ]);
38 |
39 | $user->sendEmailVerificationNotification();
40 |
41 | Auth::login($user, true);
42 |
43 | redirect(route('home'));
44 | }
45 |
46 | public function render()
47 | {
48 | return view('livewire.auth.register');
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Auth/Verify.php:
--------------------------------------------------------------------------------
1 | hasVerifiedEmail()) {
14 | redirect(route('home'));
15 | }
16 |
17 | Auth::user()->sendEmailVerificationNotification();
18 |
19 | $this->emit('resent');
20 |
21 | session()->flash('resent');
22 | }
23 |
24 | public function render()
25 | {
26 | return view('livewire.auth.verify');
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Livewire/DatatableOfContents.php:
--------------------------------------------------------------------------------
1 | "/" . Str::slug($value),
20 | 'slot' => ucfirst($value)
21 | ]);
22 | })
23 | ->label('Page')
24 | ->sortBy('id')
25 | ->defaultSort('asc'),
26 |
27 | Column::name('description')
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Livewire/DeletableDemoTable.php:
--------------------------------------------------------------------------------
1 | filterable(),
19 | Column::name('title')->filterable()->searchable(),
20 | Column::name('body')->truncate()->filterable()->searchable(),
21 | DateColumn::name('created_at')->filterable(),
22 | Column::delete()->label('delete')->alignRight()
23 | ];
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Http/Livewire/RelationDemoTable.php:
--------------------------------------------------------------------------------
1 | label('ID')
29 | ->filterable()
30 | ->linkTo('user', 6),
31 |
32 | Column::name('weapons.name')
33 | ->filterable($this->weapons->pluck('name'))
34 | ->label('Weapon Names'),
35 |
36 | NumberColumn::name('weapons.id:count')
37 | ->filterable()
38 | ->alignRight()
39 | ->label('Weapon Count'),
40 |
41 | NumberColumn::name('weapons.id:group_concat')
42 | ->filterable()
43 | ->alignRight()
44 | ->label('Weapon Concat')
45 | ->unsortable(),
46 |
47 | NumberColumn::name('weapons.id:sum')
48 | ->filterable()
49 | ->alignRight()
50 | ->label('Weapon Sum'),
51 |
52 | NumberColumn::name('weapons.id:avg')
53 | ->filterable()
54 | ->alignRight()
55 | ->label('Weapon Avg'),
56 |
57 | NumberColumn::name('weapons.id:min')
58 | ->filterable()
59 | ->alignRight()
60 | ->label('Weapon Min'),
61 |
62 | NumberColumn::name('weapons.id:max')
63 | ->filterable()
64 | ->alignRight()
65 | ->label('Weapon Max'),
66 | ];
67 | }
68 |
69 | public function getPlanetsProperty()
70 | {
71 | return Planet::pluck('name');
72 | }
73 |
74 | public function getRegionsProperty()
75 | {
76 | return Region::pluck('name');
77 | }
78 |
79 | public function getWeaponsProperty()
80 | {
81 | return Weapon::all();
82 | }
83 |
84 | public function bedtime($date)
85 | {
86 | if (!$date) {
87 | return;
88 | }
89 | return Carbon::parse($date)->isPast()
90 | ? Carbon::parse($date)->addDay()->diffForHumans(['parts' => 2])
91 | : Carbon::parse($date)->diffForHumans(['parts' => 2]);
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/app/Http/Livewire/RestoreAll.php:
--------------------------------------------------------------------------------
1 | model = $model;
14 | }
15 |
16 | public function restoreAll()
17 | {
18 | $this->model::onlyTrashed()->get()->each->restore();
19 | $this->emit('refreshLivewireDatatable');
20 | }
21 |
22 | public function render()
23 | {
24 | return <<<'blade'
25 |
26 |
27 |
28 | blade;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckForMaintenanceMode.php:
--------------------------------------------------------------------------------
1 | check()) {
22 | return redirect(route('home'));
23 | }
24 |
25 | return $next($request);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | hasMany(User::class);
13 | }
14 |
15 | public function region()
16 | {
17 | return $this->belongsTo(Region::class);
18 | }
19 |
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/app/Post.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | parent::boot();
31 |
32 | //
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
46 |
47 | $this->mapWebRoutes();
48 |
49 | //
50 | }
51 |
52 | /**
53 | * Define the "web" routes for the application.
54 | *
55 | * These routes all receive session state, CSRF protection, etc.
56 | *
57 | * @return void
58 | */
59 | protected function mapWebRoutes()
60 | {
61 | Route::middleware('web')
62 | ->namespace($this->namespace)
63 | ->group(base_path('routes/web.php'));
64 | }
65 |
66 | /**
67 | * Define the "api" routes for the application.
68 | *
69 | * These routes are typically stateless.
70 | *
71 | * @return void
72 | */
73 | protected function mapApiRoutes()
74 | {
75 | Route::prefix('api')
76 | ->middleware('api')
77 | ->namespace($this->namespace)
78 | ->group(base_path('routes/api.php'));
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/app/Region.php:
--------------------------------------------------------------------------------
1 | hasMany(Planet::class);
12 | }
13 |
14 | public function scopeWithCcps($query, $alias = 'CCPs')
15 | {
16 | $query->addSelect([$alias => User::selectRaw('GROUP_CONCAT(users.name SEPARATOR ", ") ')
17 | ->leftJoin('duty_user', 'duty_user.user_id', 'users.id')
18 | ->whereColumn('duty_user.duty_id', 'incidents.duty_id')]);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | 'datetime',
24 | ];
25 |
26 | public function car()
27 | {
28 | return $this->hasOne(Car::class);
29 | }
30 |
31 | public function comrades()
32 | {
33 | return $this->hasManyThrough(User::class, Planet::class, 'id', 'planet_id', 'planet_id', 'id');
34 | }
35 |
36 | public function posts()
37 | {
38 | return $this->hasMany(Post::class);
39 | }
40 |
41 | public function weapons()
42 | {
43 | return $this->belongsToMany(Weapon::class);
44 | }
45 |
46 | public function planet()
47 | {
48 | return $this->belongsTo(Planet::class);
49 | }
50 |
51 | public function region()
52 | {
53 | return $this->hasOneThrough(Region::class, Planet::class, 'id', 'id', 'planet_id', 'region_id');
54 | }
55 |
56 | public function scopeSelectGroupedWeaponNames($query, $alias)
57 | {
58 | $query->addSelect([
59 | $alias => Weapon::selectRaw('GROUP_CONCAT(name SEPARATOR " | ")')
60 | ->leftJoin('user_weapon', 'user_weapon.weapon_id', 'weapons.id')
61 | ->whereColumn('user_weapon.user_id', 'users.id')
62 | ]);
63 | }
64 |
65 | public function scopeFilterWeaponNames($query, $value)
66 | {
67 | $query->whereHas('weapons', function ($query) use ($value) {
68 | $query->where('weapons.id', $value);
69 | });
70 | }
71 |
72 | public function scopeHasLightSaber($query, $alias)
73 | {
74 | $query->addSelect([
75 | $alias => Weapon::selectRaw('IF(COUNT(weapons.id), 1, 0)')
76 | ->leftJoin('user_weapon', 'user_weapon.weapon_id', 'weapons.id')
77 | ->whereColumn('user_weapon.user_id', 'users.id')
78 | ->where('weapons.name', 'Light Saber')
79 | ]);
80 | }
81 |
82 | public function scopeFilterHasLightSaber($query, $value)
83 | {
84 | $query->whereHas('weapons', function ($query) use ($value) {
85 | $query->where('weapons.name', $value ? '=' : '<>', 'Light Saber');
86 | });
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/app/Weapon.php:
--------------------------------------------------------------------------------
1 | belongsToMany(User::class);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": [
6 | "framework",
7 | "laravel"
8 | ],
9 | "license": "MIT",
10 | "require": {
11 | "php": "^7.2.5|^8.0",
12 | "calebporzio/sushi": "^2.0",
13 | "fideloper/proxy": "^4.2",
14 | "fruitcake/laravel-cors": "^2.0",
15 | "fzaninotto/faker": "^1.9.1",
16 | "guzzlehttp/guzzle": "^6.3",
17 | "laravel-frontend-presets/tall": "^1.7",
18 | "laravel/framework": "^7.25",
19 | "laravel/tinker": "^2.0",
20 | "laravel/vapor-core": "^2.8",
21 | "league/flysystem-aws-s3-v3": "^1.0",
22 | "livewire/livewire": "^2.2",
23 | "mediconesystems/livewire-datatables": "^0.6"
24 | },
25 | "require-dev": {
26 | "barryvdh/laravel-debugbar": "^3.3",
27 | "facade/ignition": "^2.0",
28 | "mockery/mockery": "^1.3.1",
29 | "nunomaduro/collision": "^4.1",
30 | "phpunit/phpunit": "^8.5"
31 | },
32 | "repositories": [],
33 | "config": {
34 | "optimize-autoloader": true,
35 | "preferred-install": "dist",
36 | "sort-packages": true
37 | },
38 | "extra": {
39 | "laravel": {
40 | "dont-discover": []
41 | }
42 | },
43 | "autoload": {
44 | "psr-4": {
45 | "App\\": "app/"
46 | },
47 | "classmap": [
48 | "database/seeds",
49 | "database/factories"
50 | ]
51 | },
52 | "autoload-dev": {
53 | "psr-4": {
54 | "Tests\\": "tests/"
55 | }
56 | },
57 | "minimum-stability": "dev",
58 | "prefer-stable": true,
59 | "scripts": {
60 | "post-autoload-dump": [
61 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
62 | "@php artisan package:discover --ansi"
63 | ],
64 | "post-root-package-install": [
65 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
66 | ],
67 | "post-create-project-cmd": [
68 | "@php artisan key:generate --ansi"
69 | ]
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'token',
46 | 'provider' => 'users',
47 | 'hash' => false,
48 | ],
49 | ],
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | User Providers
54 | |--------------------------------------------------------------------------
55 | |
56 | | All authentication drivers have a user provider. This defines how the
57 | | users are actually retrieved out of your database or other storage
58 | | mechanisms used by this application to persist your user's data.
59 | |
60 | | If you have multiple user tables or models you may configure multiple
61 | | sources which represent each model / table. These sources may then
62 | | be assigned to any extra authentication guards you have defined.
63 | |
64 | | Supported: "database", "eloquent"
65 | |
66 | */
67 |
68 | 'providers' => [
69 | 'users' => [
70 | 'driver' => 'eloquent',
71 | 'model' => App\User::class,
72 | ],
73 |
74 | // 'users' => [
75 | // 'driver' => 'database',
76 | // 'table' => 'users',
77 | // ],
78 | ],
79 |
80 | /*
81 | |--------------------------------------------------------------------------
82 | | Resetting Passwords
83 | |--------------------------------------------------------------------------
84 | |
85 | | You may specify multiple password reset configurations if you have more
86 | | than one user table or model in the application and you want to have
87 | | separate password reset settings based on the specific user types.
88 | |
89 | | The expire time is the number of minutes that the reset token should be
90 | | considered valid. This security feature keeps tokens short-lived so
91 | | they have less time to be guessed. You may change this as needed.
92 | |
93 | */
94 |
95 | 'passwords' => [
96 | 'users' => [
97 | 'provider' => 'users',
98 | 'table' => 'password_resets',
99 | 'expire' => 60,
100 | 'throttle' => 60,
101 | ],
102 | ],
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Password Confirmation Timeout
107 | |--------------------------------------------------------------------------
108 | |
109 | | Here you may define the amount of seconds before a password confirmation
110 | | times out and the user is prompted to re-enter their password via the
111 | | confirmation screen. By default, the timeout lasts for three hours.
112 | |
113 | */
114 |
115 | 'password_timeout' => 10800,
116 |
117 | ];
118 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'useTLS' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Cache Stores
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may define all of the cache "stores" for your application as
29 | | well as their drivers. You may even define multiple stores for the
30 | | same cache driver to group types of items stored in your caches.
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | 'serialize' => false,
43 | ],
44 |
45 | 'database' => [
46 | 'driver' => 'database',
47 | 'table' => 'cache',
48 | 'connection' => null,
49 | ],
50 |
51 | 'file' => [
52 | 'driver' => 'file',
53 | 'path' => storage_path('framework/cache/data'),
54 | ],
55 |
56 | 'memcached' => [
57 | 'driver' => 'memcached',
58 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
59 | 'sasl' => [
60 | env('MEMCACHED_USERNAME'),
61 | env('MEMCACHED_PASSWORD'),
62 | ],
63 | 'options' => [
64 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
65 | ],
66 | 'servers' => [
67 | [
68 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
69 | 'port' => env('MEMCACHED_PORT', 11211),
70 | 'weight' => 100,
71 | ],
72 | ],
73 | ],
74 |
75 | 'redis' => [
76 | 'driver' => 'redis',
77 | 'connection' => 'cache',
78 | ],
79 |
80 | 'dynamodb' => [
81 | 'driver' => 'dynamodb',
82 | 'key' => env('AWS_ACCESS_KEY_ID'),
83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
86 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
87 | ],
88 |
89 | ],
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Cache Key Prefix
94 | |--------------------------------------------------------------------------
95 | |
96 | | When utilizing a RAM based store such as APC or Memcached, there might
97 | | be other applications utilizing the same cache. So, we'll specify a
98 | | value to get prefixed to all our keys so we can avoid collisions.
99 | |
100 | */
101 |
102 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
103 |
104 | ];
105 |
--------------------------------------------------------------------------------
/config/cors.php:
--------------------------------------------------------------------------------
1 | ['api/*'],
19 |
20 | 'allowed_methods' => ['*'],
21 |
22 | 'allowed_origins' => ['*'],
23 |
24 | 'allowed_origins_patterns' => [],
25 |
26 | 'allowed_headers' => ['*'],
27 |
28 | 'exposed_headers' => [],
29 |
30 | 'max_age' => 0,
31 |
32 | 'supports_credentials' => false,
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "sftp", "s3"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_ACCESS_KEY_ID'),
61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
62 | 'region' => env('AWS_DEFAULT_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | 'url' => env('AWS_URL'),
65 | 'endpoint' => env('AWS_ENDPOINT'),
66 | ],
67 |
68 | ],
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Symbolic Links
73 | |--------------------------------------------------------------------------
74 | |
75 | | Here you may configure the symbolic links that will be created when the
76 | | `storage:link` Artisan command is executed. The array keys should be
77 | | the locations of the links and the values should be their targets.
78 | |
79 | */
80 |
81 | 'links' => [
82 | public_path('storage') => storage_path('app/public'),
83 | ],
84 |
85 | ];
86 |
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/config/livewire-datatables.php:
--------------------------------------------------------------------------------
1 | 'H:i',
6 | 'default_date_format' => 'd/m/Y'
7 |
8 | ];
9 |
--------------------------------------------------------------------------------
/config/livewire.php:
--------------------------------------------------------------------------------
1 | 'App\\Http\\Livewire',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This value sets the path for Livewire component views. This affects
26 | | file manipulation helper commands like `artisan make:livewire`.
27 | |
28 | */
29 |
30 | 'view_path' => resource_path('views/livewire'),
31 |
32 | /*
33 | |--------------------------------------------------------------------------
34 | | Livewire Assets URL
35 | |--------------------------------------------------------------------------
36 | |
37 | | This value sets the path to Livewire JavaScript assets, for cases where
38 | | your app's domain root is not the correct path. By default, Livewire
39 | | will load its JavaScript assets from the app's "relative root".
40 | |
41 | | Examples: "/assets", "myurl.com/app".
42 | |
43 | */
44 |
45 | 'asset_url' => null,
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Livewire Endpoint Middleware Group
50 | |--------------------------------------------------------------------------
51 | |
52 | | This value sets the middleware group that will be applied to the main
53 | | Livewire "message" endpoint (the endpoint that gets hit everytime
54 | | a Livewire component updates). It is set to "web" by default.
55 | |
56 | */
57 |
58 | 'middleware_group' => 'web',
59 |
60 | /*
61 | |--------------------------------------------------------------------------
62 | | Livewire Temporary File Uploads Endpoint Configuration
63 | |--------------------------------------------------------------------------
64 | |
65 | | Livewire handles file uploads by storing uploads in a temporary directory
66 | | before the file is validated and stored permanently. All file uploads
67 | | are directed to a global endpoint for temporary storage. The config
68 | | items below are used for customizing the way the endpoint works.
69 | |
70 | */
71 |
72 | 'temporary_file_upload' => [
73 | 'disk' => null, // Example: 'local', 's3' Default: 'default'
74 | 'rules' => null, // Example: ['file', 'mimes:png,jpg'] Default: ['required', 'file', 'max:12288'] (12MB)
75 | 'directory' => null, // Example: 'tmp' Default 'livewire-tmp'
76 | 'middleware' => null, // Example: 'throttle:5,1' Default: 'throttle:60,1'
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Manifest File Path
82 | |--------------------------------------------------------------------------
83 | |
84 | | This value sets the path to the Livewire manifest file.
85 | | The default should work for most cases (which is
86 | | "/bootstrap/cache/livewire-components.php)", but for specific
87 | | cases like when hosting on Laravel Vapor, it could be set to a different value.
88 | |
89 | | Example: for Laravel Vapor, it would be "/tmp/storage/bootstrap/cache/livewire-components.php".
90 | |
91 | */
92 |
93 | 'manifest_path' => null,
94 |
95 | ];
96 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Log Channels
25 | |--------------------------------------------------------------------------
26 | |
27 | | Here you may configure the log channels for your application. Out of
28 | | the box, Laravel uses the Monolog PHP logging library. This gives
29 | | you a variety of powerful log handlers / formatters to utilize.
30 | |
31 | | Available Drivers: "single", "daily", "slack", "syslog",
32 | | "errorlog", "monolog",
33 | | "custom", "stack"
34 | |
35 | */
36 |
37 | 'channels' => [
38 | 'stack' => [
39 | 'driver' => 'stack',
40 | 'channels' => ['single'],
41 | 'ignore_exceptions' => false,
42 | ],
43 |
44 | 'single' => [
45 | 'driver' => 'single',
46 | 'path' => storage_path('logs/laravel.log'),
47 | 'level' => 'debug',
48 | ],
49 |
50 | 'daily' => [
51 | 'driver' => 'daily',
52 | 'path' => storage_path('logs/laravel.log'),
53 | 'level' => 'debug',
54 | 'days' => 14,
55 | ],
56 |
57 | 'slack' => [
58 | 'driver' => 'slack',
59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
60 | 'username' => 'Laravel Log',
61 | 'emoji' => ':boom:',
62 | 'level' => 'critical',
63 | ],
64 |
65 | 'papertrail' => [
66 | 'driver' => 'monolog',
67 | 'level' => 'debug',
68 | 'handler' => SyslogUdpHandler::class,
69 | 'handler_with' => [
70 | 'host' => env('PAPERTRAIL_URL'),
71 | 'port' => env('PAPERTRAIL_PORT'),
72 | ],
73 | ],
74 |
75 | 'stderr' => [
76 | 'driver' => 'monolog',
77 | 'handler' => StreamHandler::class,
78 | 'formatter' => env('LOG_STDERR_FORMATTER'),
79 | 'with' => [
80 | 'stream' => 'php://stderr',
81 | ],
82 | ],
83 |
84 | 'syslog' => [
85 | 'driver' => 'syslog',
86 | 'level' => 'debug',
87 | ],
88 |
89 | 'errorlog' => [
90 | 'driver' => 'errorlog',
91 | 'level' => 'debug',
92 | ],
93 |
94 | 'null' => [
95 | 'driver' => 'monolog',
96 | 'handler' => NullHandler::class,
97 | ],
98 |
99 | 'emergency' => [
100 | 'path' => storage_path('logs/laravel.log'),
101 | ],
102 | ],
103 |
104 | ];
105 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'smtp'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Mailer Configurations
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure all of the mailers used by your application plus
24 | | their respective settings. Several examples have been configured for
25 | | you and you are free to add your own as your application requires.
26 | |
27 | | Laravel supports a variety of mail "transport" drivers to be used while
28 | | sending an e-mail. You will specify which one you are using for your
29 | | mailers below. You are free to add additional mailers as required.
30 | |
31 | | Supported: "smtp", "sendmail", "mailgun", "ses",
32 | | "postmark", "log", "array"
33 | |
34 | */
35 |
36 | 'mailers' => [
37 | 'smtp' => [
38 | 'transport' => 'smtp',
39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
40 | 'port' => env('MAIL_PORT', 587),
41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
42 | 'username' => env('MAIL_USERNAME'),
43 | 'password' => env('MAIL_PASSWORD'),
44 | 'timeout' => null,
45 | 'auth_mode' => null,
46 | ],
47 |
48 | 'ses' => [
49 | 'transport' => 'ses',
50 | ],
51 |
52 | 'mailgun' => [
53 | 'transport' => 'mailgun',
54 | ],
55 |
56 | 'postmark' => [
57 | 'transport' => 'postmark',
58 | ],
59 |
60 | 'sendmail' => [
61 | 'transport' => 'sendmail',
62 | 'path' => '/usr/sbin/sendmail -bs',
63 | ],
64 |
65 | 'log' => [
66 | 'transport' => 'log',
67 | 'channel' => env('MAIL_LOG_CHANNEL'),
68 | ],
69 |
70 | 'array' => [
71 | 'transport' => 'array',
72 | ],
73 | ],
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Global "From" Address
78 | |--------------------------------------------------------------------------
79 | |
80 | | You may wish for all e-mails sent by your application to be sent from
81 | | the same address. Here, you may specify a name and address that is
82 | | used globally for all e-mails that are sent by your application.
83 | |
84 | */
85 |
86 | 'from' => [
87 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
88 | 'name' => env('MAIL_FROM_NAME', 'Example'),
89 | ],
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Markdown Mail Settings
94 | |--------------------------------------------------------------------------
95 | |
96 | | If you are using Markdown based email rendering, you may configure your
97 | | theme and component paths here, allowing you to customize the design
98 | | of the emails. Or, you may simply stick with the Laravel defaults!
99 | |
100 | */
101 |
102 | 'markdown' => [
103 | 'theme' => 'default',
104 |
105 | 'paths' => [
106 | resource_path('views/vendor/mail'),
107 | ],
108 | ],
109 |
110 | ];
111 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | 'block_for' => 0,
50 | ],
51 |
52 | 'sqs' => [
53 | 'driver' => 'sqs',
54 | 'key' => env('AWS_ACCESS_KEY_ID'),
55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'),
58 | 'suffix' => env('SQS_SUFFIX'),
59 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
60 | ],
61 |
62 | 'redis' => [
63 | 'driver' => 'redis',
64 | 'connection' => 'default',
65 | 'queue' => env('REDIS_QUEUE', 'default'),
66 | 'retry_after' => 90,
67 | 'block_for' => null,
68 | ],
69 |
70 | ],
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | Failed Queue Jobs
75 | |--------------------------------------------------------------------------
76 | |
77 | | These options configure the behavior of failed queue job logging so you
78 | | can control which database and table are used to store the jobs that
79 | | have failed. You may change them to any database / table you wish.
80 | |
81 | */
82 |
83 | 'failed' => [
84 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
85 | 'database' => env('DB_CONNECTION', 'mysql'),
86 | 'table' => 'failed_jobs',
87 | ],
88 |
89 | ];
90 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'postmark' => [
24 | 'token' => env('POSTMARK_TOKEN'),
25 | ],
26 |
27 | 'ses' => [
28 | 'key' => env('AWS_ACCESS_KEY_ID'),
29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
31 | ],
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 | *.sqlite-journal
3 |
--------------------------------------------------------------------------------
/database/factories/CarFactory.php:
--------------------------------------------------------------------------------
1 | define(Car::class, function (Faker $faker) {
9 | return [
10 | 'model' => $faker->randomElement(['Audi', 'BMW', 'Caterham', 'Dodge', 'Ferrari', 'Jaguar', 'Lamborghini', 'Porsche']),
11 | 'year' => $faker->year()
12 | ];
13 | });
14 |
--------------------------------------------------------------------------------
/database/factories/PostFactory.php:
--------------------------------------------------------------------------------
1 | define(Post::class, function (Faker $faker) {
9 | return [
10 | 'title' => $faker->words(3, true),
11 | 'body' => $faker->paragraphs(2, true)
12 | ];
13 | });
14 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(User::class, function (Faker $faker) {
22 | return [
23 | 'name' => $faker->name,
24 | 'email' => $faker->unique()->safeEmail,
25 | 'email_verified_at' => rand() % 4 === 0 ? now() : null,
26 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
27 | 'remember_token' => Str::random(10),
28 | 'bedtime' => rand(0, 10) > 3 ? $faker->dateTimeBetween('19:00', '23:59') : $faker->dateTimeBetween('00:00', '03:59'),
29 | 'dob' => $faker->dateTimeBetween('- 100 years'),
30 | 'role' => $faker->randomElement(['Stormtrooper', 'AT-AT Pilot', 'AT-ST Driver', 'Imperial Guard', 'Shock Trooper', 'Shadow Trooper', 'Purge Trooper', 'Jumptrooper', null]),
31 | 'bio' => $faker->paragraphs(2, true),
32 | 'planet_id' => $faker->numberBetween(1, Planet::all()->count()),
33 | 'latitude' => $faker->latitude(50.5, 51.5),
34 | 'longitude' => $faker->longitude(-1.5, 1.5),
35 | ];
36 | });
37 |
--------------------------------------------------------------------------------
/database/factories/WeaponFactory.php:
--------------------------------------------------------------------------------
1 | define(Weapon::class, function (Faker $faker) {
9 | return [
10 | //
11 | ];
12 | });
13 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->unsignedInteger('planet_id')->nullable()->index();
19 | $table->string('name');
20 | $table->string('email');
21 | $table->timestamp('email_verified_at')->nullable();
22 | $table->string('password');
23 | $table->date('dob')->nullable();
24 | $table->time('bedtime')->nullable();
25 | $table->string('role')->nullable();
26 | $table->text('bio')->nullable();
27 | $table->decimal('latitude', 10, 8)->nullable();
28 | $table->decimal('longitude', 11, 8)->nullable();
29 | $table->rememberToken();
30 | $table->timestamps();
31 | $table->softDeletes();
32 | });
33 | }
34 |
35 | /**
36 | * Reverse the migrations.
37 | *
38 | * @return void
39 | */
40 | public function down()
41 | {
42 | Schema::dropIfExists('users');
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->text('connection');
19 | $table->text('queue');
20 | $table->longText('payload');
21 | $table->longText('exception');
22 | $table->timestamp('failed_at')->useCurrent();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('failed_jobs');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2020_06_24_110922_create_weapons_table.php:
--------------------------------------------------------------------------------
1 | id();
13 | $table->string('name');
14 | $table->unsignedInteger('power');
15 | $table->timestamps();
16 | });
17 | }
18 |
19 | public function down()
20 | {
21 | Schema::dropIfExists('weapons');
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/database/migrations/2020_06_24_111709_create_user_weapon_table.php:
--------------------------------------------------------------------------------
1 | id();
13 | $table->unsignedInteger('user_id')->index();
14 | $table->unsignedInteger('weapon_id')->index();
15 | $table->timestamps();
16 | });
17 | }
18 |
19 | public function down()
20 | {
21 | Schema::dropIfExists('user_weapon');
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/database/migrations/2020_06_28_005157_create_planets_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->unsignedInteger('region_id')->nullable()->index();
19 | $table->string('name', 32)->nullable()->index();
20 | $table->integer('orbital_period')->nullable();
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::dropIfExists('planets');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2020_06_28_155531_create_pages_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('title', 32);
19 | $table->text('description');
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::dropIfExists('pages');
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/2020_07_27_232421_create_regions_table.php:
--------------------------------------------------------------------------------
1 | id();
13 | $table->string('name', 32);
14 | $table->timestamps();
15 | });
16 | }
17 |
18 | /**
19 | * Reverse the migrations.
20 | *
21 | * @return void
22 | */
23 | public function down()
24 | {
25 | Schema::dropIfExists('regions');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/database/migrations/2020_07_30_140508_create_cars_table.php:
--------------------------------------------------------------------------------
1 | id();
13 | $table->unsignedInteger('user_id')->index();
14 | $table->string('model', 16);
15 | $table->year('year');
16 | $table->timestamps();
17 | });
18 | }
19 |
20 | public function down()
21 | {
22 | Schema::dropIfExists('cars');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/database/migrations/2020_07_30_144348_create_posts_table.php:
--------------------------------------------------------------------------------
1 | id();
13 | $table->unsignedInteger('user_id')->index();
14 | $table->string('title', 64);
15 | $table->text('body')->nullable();
16 | $table->timestamps();
17 | $table->softDeletes();
18 | });
19 | }
20 |
21 | public function down()
22 | {
23 | Schema::dropIfExists('posts');
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/database/seeds/CarSeeder.php:
--------------------------------------------------------------------------------
1 | call(RegionSeeder::class);
15 | $this->call(PlanetSeeder::class);
16 | $this->call(WeaponSeeder::class);
17 | $this->call(PageSeeder::class);
18 | $this->call(UserSeeder::class);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/database/seeds/PageSeeder.php:
--------------------------------------------------------------------------------
1 | 'simple', 'description' => 'A simple datatable using only the livewire-datatables template tag and a model']);
11 | Page::create(['title' => 'intermediate', 'description' => 'Take control of your datatable by adding props']);
12 | Page::create(['title' => 'complex', 'description' => 'Master control over each field using fluent class methods']);
13 | Page::create(['title' => 'relation', 'description' => 'Create aggregate columns from Eloquent relations']);
14 | Page::create(['title' => 'deletable', 'description' => 'Delete rows by adding a delete column']);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/database/seeds/RegionSeeder.php:
--------------------------------------------------------------------------------
1 | 'Deep Core']);
11 | Region::create(['name' => 'Core Worlds']);
12 | Region::create(['name' => 'Colonies']);
13 | Region::create(['name' => 'Inner Rim']);
14 | Region::create(['name' => 'Expansion Region']);
15 | Region::create(['name' => 'Mid Rim']);
16 | Region::create(['name' => 'Outer Rim Territories']);
17 | Region::create(['name' => 'Unknown Regions']);
18 | Region::create(['name' => 'Western']);
19 | Region::create(['name' => 'Wild Space']);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/database/seeds/UserSeeder.php:
--------------------------------------------------------------------------------
1 | create();
15 |
16 | $weapons = Weapon::all();
17 |
18 | User::all()->each(function ($user) use ($weapons) {
19 | $user->car()->save(factory(Car::class)->make());
20 | for ($i = 0; $i < rand(0, 5); $i++) {
21 | $user->posts()->save(factory(Post::class)->make());
22 | }
23 | $user->weapons()->attach($weapons->random(rand(0, 3)));
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/database/seeds/WeaponSeeder.php:
--------------------------------------------------------------------------------
1 | 'Light Saber',
13 | 'power' => 1000,
14 | ]);
15 |
16 | Weapon::create([
17 | 'name' => 'T-21 Light Blaster',
18 | 'power' => 100,
19 | ]);
20 |
21 | Weapon::create([
22 | 'name' => 'RT-97C Heavy Blaster',
23 | 'power' => 300,
24 | ]);
25 |
26 | Weapon::create([
27 | 'name' => 'Shock Grenade',
28 | 'power' => 500,
29 | ]);
30 |
31 | Weapon::create([
32 | 'name' => 'Thermal Detonator',
33 | 'power' => 500,
34 | ]);
35 |
36 | Weapon::create([
37 | 'name' => 'Force Lightning',
38 | 'power' => 2000,
39 | ]);
40 |
41 | Weapon::create([
42 | 'name' => 'Bowcaster',
43 | 'power' => 600,
44 | ]);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "npm run development -- --watch",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "@tailwindcss/custom-forms": "^0.2",
14 | "@tailwindcss/ui": "^0.1",
15 | "alpinejs": "^3.2.3",
16 | "browser-sync": "^2.27.5",
17 | "browser-sync-webpack-plugin": "^2.0.1",
18 | "cross-env": "^7.0",
19 | "laravel-mix": "^5.0.1",
20 | "laravel-mix-tailwind": "^0.1.0",
21 | "resolve-url-loader": "^3.1.0",
22 | "sass": "^1.15.2",
23 | "sass-loader": "^8.0.0",
24 | "tailwindcss": "^2.2.4",
25 | "vue-template-compiler": "^2.6.11"
26 | },
27 | "dependencies": {
28 | "@alpinejs/persist": "^3.2.3",
29 | "@tailwindcss/forms": "^0.3.3",
30 | "autoprefixer": "^10.2.6",
31 | "postcss": "^8.3.5",
32 | "prismjs": "^1.24.1",
33 | "turbolinks": "^5.2.0"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | ./tests/Unit
10 |
11 |
12 | ./tests/Feature
13 |
14 |
15 |
16 |
17 | ./app
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/public/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/public/.DS_Store
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Send Requests To Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/public/MOS_favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/public/MOS_favicon.png
--------------------------------------------------------------------------------
/public/css/prism.css:
--------------------------------------------------------------------------------
1 | /* PrismJS 1.20.0
2 | https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+clike+markup-templating+php */
3 | /**
4 | * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
5 | * Based on https://github.com/chriskempson/tomorrow-theme
6 | * @author Rose Pritchard
7 | */
8 |
9 | code[class*="language-"],
10 | pre[class*="language-"] {
11 | color: #ccc;
12 | background: none;
13 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
14 | font-size: 1em;
15 | text-align: left;
16 | white-space: pre;
17 | word-spacing: normal;
18 | word-break: normal;
19 | word-wrap: normal;
20 | line-height: 1.5;
21 |
22 | -moz-tab-size: 4;
23 | -o-tab-size: 4;
24 | tab-size: 4;
25 |
26 | -webkit-hyphens: none;
27 | -moz-hyphens: none;
28 | -ms-hyphens: none;
29 | hyphens: none;
30 |
31 | }
32 |
33 | /* Code blocks */
34 | pre[class*="language-"] {
35 | padding: 1em;
36 | margin: .5em 0;
37 | overflow: auto;
38 | }
39 |
40 | :not(pre) > code[class*="language-"],
41 | pre[class*="language-"] {
42 | background: #2d2d2d;
43 | }
44 |
45 | /* Inline code */
46 | :not(pre) > code[class*="language-"] {
47 | padding: .1em;
48 | border-radius: .3em;
49 | white-space: normal;
50 | }
51 |
52 | .token.comment,
53 | .token.block-comment,
54 | .token.prolog,
55 | .token.doctype,
56 | .token.cdata {
57 | color: #999;
58 | }
59 |
60 | .token.punctuation {
61 | color: #ccc;
62 | }
63 |
64 | .token.tag,
65 | .token.attr-name,
66 | .token.namespace,
67 | .token.deleted {
68 | color: #e2777a;
69 | }
70 |
71 | .token.function-name {
72 | color: #6196cc;
73 | }
74 |
75 | .token.boolean,
76 | .token.number,
77 | .token.function {
78 | color: #f08d49;
79 | }
80 |
81 | .token.property,
82 | .token.class-name,
83 | .token.constant,
84 | .token.symbol {
85 | color: #f8c555;
86 | }
87 |
88 | .token.selector,
89 | .token.important,
90 | .token.atrule,
91 | .token.keyword,
92 | .token.builtin {
93 | color: #cc99cd;
94 | }
95 |
96 | .token.string,
97 | .token.char,
98 | .token.attr-value,
99 | .token.regex,
100 | .token.variable {
101 | color: #7ec699;
102 | }
103 |
104 | .token.operator,
105 | .token.entity,
106 | .token.url {
107 | color: #67cdcc;
108 | }
109 |
110 | .token.important,
111 | .token.bold {
112 | font-weight: bold;
113 | }
114 | .token.italic {
115 | font-style: italic;
116 | }
117 |
118 | .token.entity {
119 | cursor: help;
120 | }
121 |
122 | .token.inserted {
123 | color: green;
124 | }
125 |
126 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | define('LARAVEL_START', microtime(true));
11 |
12 | /*
13 | |--------------------------------------------------------------------------
14 | | Register The Auto Loader
15 | |--------------------------------------------------------------------------
16 | |
17 | | Composer provides a convenient, automatically generated class loader for
18 | | our application. We just need to utilize it! We'll simply require it
19 | | into the script here so that we don't have to worry about manual
20 | | loading any of our classes later on. It feels great to relax.
21 | |
22 | */
23 |
24 | require __DIR__.'/../vendor/autoload.php';
25 |
26 | /*
27 | |--------------------------------------------------------------------------
28 | | Turn On The Lights
29 | |--------------------------------------------------------------------------
30 | |
31 | | We need to illuminate PHP development, so let us turn on the lights.
32 | | This bootstraps the framework and gets it ready for use, then it
33 | | will load up this application so that we can run it and send
34 | | the responses back to the browser and delight our users.
35 | |
36 | */
37 |
38 | $app = require_once __DIR__.'/../bootstrap/app.php';
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Run The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once we have the application, we can handle the incoming request
46 | | through the kernel, and send the associated response back to
47 | | the client's browser allowing them to enjoy the creative
48 | | and wonderful application we have prepared for them.
49 | |
50 | */
51 |
52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
53 |
54 | $response = $kernel->handle(
55 | $request = Illuminate\Http\Request::capture()
56 | );
57 |
58 | $response->send();
59 |
60 | $kernel->terminate($request, $response);
61 |
--------------------------------------------------------------------------------
/public/mix-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/js/app.js": "/js/app.js?id=da0557332ac8316a41f1",
3 | "/css/app.css": "/css/app.css?id=cb24f2e12b29b5d1fe50",
4 | "/js/app.js.map": "/js/app.js.map?id=2f6969032e89f6f994b6",
5 | "/css/app.css.map": "/css/app.css.map?id=e88c7155c5c4ec6007b0"
6 | }
7 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/resources/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/resources/.DS_Store
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import Alpine from 'alpinejs'
2 | import persist from '@alpinejs/persist'
3 |
4 | Alpine.plugin(persist)
5 |
6 | window.Alpine = Alpine
7 |
8 | Alpine.start()
9 |
--------------------------------------------------------------------------------
/resources/lang/en/auth.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/resources/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/resources/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Your password has been reset!',
17 | 'sent' => 'We have emailed your password reset link!',
18 | 'throttled' => 'Please wait before retrying.',
19 | 'token' => 'This password reset token is invalid.',
20 | 'user' => "We can't find a user with that email address.",
21 |
22 | ];
23 |
--------------------------------------------------------------------------------
/resources/sass/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/resources/sass/.DS_Store
--------------------------------------------------------------------------------
/resources/sass/app.scss:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 |
3 | input:invalid,
4 | textarea:invalid,
5 | select:invalid {
6 | box-shadow: none;
7 | }
8 |
9 | @tailwind components;
10 |
11 | @tailwind utilities;
12 |
13 | [x-cloak] {
14 | display: none;
15 | }
16 |
--------------------------------------------------------------------------------
/resources/views/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/resources/views/.DS_Store
--------------------------------------------------------------------------------
/resources/views/actions.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('title', 'Actions')
3 | @section('content')
4 |
5 |
Actions
6 |
7 |
8 |
9 |
10 |
11 |
12 | @verbatim
13 |
14 |
15 |
16 |
17 | @endverbatim
18 |
19 |
20 |
21 |
22 |
23 |
24 | @endsection
25 |
--------------------------------------------------------------------------------
/resources/views/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 | @section('title', 'Sign in to your account')
3 |
4 | @section('content')
5 |
6 | @livewire('auth.login')
7 |
8 | @endsection
9 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/confirm.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 | @section('title', 'Confirm your password')
3 |
4 | @section('content')
5 |
6 | @livewire('auth.passwords.confirm')
7 |
8 | @endsection
9 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/email.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 | @section('title', 'Reset password')
3 |
4 | @section('content')
5 |
6 | @livewire('auth.passwords.email')
7 |
8 | @endsection
9 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/reset.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 | @section('title', 'Reset password')
3 |
4 | @section('content')
5 |
6 | @livewire('auth.passwords.reset', [
7 | 'token' => $token
8 | ])
9 |
10 | @endsection
11 |
--------------------------------------------------------------------------------
/resources/views/auth/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 | @section('title', 'Create a new account')
3 |
4 | @section('content')
5 |
6 | @livewire('auth.register')
7 |
8 | @endsection
9 |
--------------------------------------------------------------------------------
/resources/views/auth/verify.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 | @section('title', 'Verify your email address')
3 |
4 | @section('content')
5 |
6 | @livewire('auth.verify')
7 |
8 | @endsection
9 |
--------------------------------------------------------------------------------
/resources/views/complex.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('title', 'Complex')
3 | @section('content')
4 |
5 |
Complex
6 |
7 |
8 |
9 |
10 | @verbatim
11 |
12 | @endverbatim
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | @endsection
22 |
--------------------------------------------------------------------------------
/resources/views/components/code.blade.php:
--------------------------------------------------------------------------------
1 |
2 | @isset($path)
{{ e($path) }}@endisset
3 | @isset($file)
4 |
{{ str_replace('\\', '/', $file) }}
5 |
{{ file_get_contents(base_path($file)) }}
6 | @else
7 |
{{ e($slot) }}
8 | @endisset
9 |
10 |
--------------------------------------------------------------------------------
/resources/views/components/email.blade.php:
--------------------------------------------------------------------------------
1 | {{ $value }}
2 |
--------------------------------------------------------------------------------
/resources/views/components/github.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/components/logo.blade.php:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/resources/views/components/modal.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ $trigger }}
4 |
5 |
6 |
43 |
44 |
--------------------------------------------------------------------------------
/resources/views/components/selected.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! print_r($selected, true) !!}
3 |
4 |
--------------------------------------------------------------------------------
/resources/views/deletable.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('title', 'Complex')
3 | @section('content')
4 |
5 |
Deletable
6 |
7 |
8 |
9 |
10 |
11 |
12 | @verbatim
13 |
14 |
15 |
16 | @endverbatim
17 |
18 |
19 |
20 |
21 |
22 |
23 | @endsection
24 |
--------------------------------------------------------------------------------
/resources/views/home.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('title', 'Home')
3 | @section('content')
4 |
5 |
6 |
7 |
Datatable of Contents
8 |
9 |
10 |
11 |
12 | @verbatim
13 |
14 | @endverbatim
15 |
16 |
17 |
18 |
19 |
20 | @endsection
21 |
--------------------------------------------------------------------------------
/resources/views/icons/arrow-left.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/icons/arrow-right.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/icons/check-circle.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/icons/chevron-down.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/icons/chevron-up.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/icons/cog.blade.php:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/resources/views/icons/x-circle.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/intermediate.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('title', 'Intermediate ')
3 | @section('content')
4 |
5 |
Intermediate
6 |
7 |
19 |
20 |
21 |
22 | @verbatim
23 |
35 | @endverbatim
36 |
37 |
38 | @endsection
39 |
--------------------------------------------------------------------------------
/resources/views/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.base')
2 | @section('body')
3 |
4 |
36 |
37 | @yield('content')
38 |
39 |
40 | @endsection
41 |
--------------------------------------------------------------------------------
/resources/views/layouts/auth.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.base')
2 |
3 | @section('body')
4 |
5 | @yield('content')
6 |
7 | @endsection
8 |
--------------------------------------------------------------------------------
/resources/views/layouts/base.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | @hasSection('title')
11 | @yield('title') - {{ config('app.name') }}
12 | @else
13 | {{ config('app.name') }}
14 | @endif
15 |
16 |
17 |
18 |
19 | @livewireStyles
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | @yield('body')
29 | @livewireScripts
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/resources/views/livewire/auth/login.blade.php:
--------------------------------------------------------------------------------
1 |
75 |
--------------------------------------------------------------------------------
/resources/views/livewire/auth/passwords/confirm.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 | Please confirm your password before continuing
12 |
13 |
14 |
15 |
50 |
51 |
--------------------------------------------------------------------------------
/resources/views/livewire/auth/passwords/email.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 | @if ($emailSentMessage)
15 |
16 |
17 |
22 |
23 |
24 |
25 | {{ $emailSentMessage }}
26 |
27 |
28 |
29 |
30 | @else
31 |
54 | @endif
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/resources/views/livewire/auth/passwords/reset.blade.php:
--------------------------------------------------------------------------------
1 |
66 |
--------------------------------------------------------------------------------
/resources/views/livewire/auth/verify.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
24 |
25 | @if (session('resent'))
26 |
27 |
30 |
31 |
A fresh verification link has been sent to your email address.
32 |
33 | @endif
34 |
35 |
36 |
Before proceeding, please check your email for a verification link.
37 |
38 |
39 | If you did not receive the email, click here to request another.
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/boolean.blade.php:
--------------------------------------------------------------------------------
1 |
2 | @if($value)
3 |
4 | @else
5 |
6 | @endif
7 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/delete.blade.php:
--------------------------------------------------------------------------------
1 |
58 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/editable.blade.php:
--------------------------------------------------------------------------------
1 |
15 |
17 |
18 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/filters/boolean.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | @isset($this->activeBooleanFilters[$index])
16 | @if($this->activeBooleanFilters[$index] == 1)
17 |
22 | @elseif(strlen($this->activeBooleanFilters[$index]) > 0)
23 |
28 | @endif
29 | @endisset
30 |
31 |
32 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/filters/date.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
9 |
10 |
11 |
12 |
14 |
15 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/filters/editable.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 | @foreach($this->activeTextFilters[$index] ?? [] as $key => $value)
11 |
15 | @endforeach
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/filters/number.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
25 |
26 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/filters/select.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
24 |
25 |
26 | @foreach($this->activeSelectFilters[$index] ?? [] as $key => $value)
27 |
32 | @endforeach
33 |
34 |
35 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/filters/string.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 | @foreach($this->activeTextFilters[$index] ?? [] as $key => $value)
11 |
15 | @endforeach
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/filters/time.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
9 |
10 |
11 |
12 |
14 |
15 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/header-inline-hide.blade.php:
--------------------------------------------------------------------------------
1 |
5 |
11 |
15 |
16 |
18 | @if($column['unsortable'])
19 |
20 | {{ str_replace('_', ' ', $column['label']) }}
21 |
22 | @else
23 |
36 | @endif
37 |
41 |
42 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/header-no-hide.blade.php:
--------------------------------------------------------------------------------
1 | @unless($column['hidden'])
2 |
3 | @if($column['unsortable'])
4 |
5 | {{ str_replace('_', ' ', $column['label']) }}
6 |
7 | @else
8 |
20 | @endif
21 |
22 | @endif
23 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/hide-column-multiselect.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 | @foreach($this->columns as $index => $column)
11 |
12 |
13 |
14 |
15 |
{{ $column['label'] }}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
{{ $column['label'] }}
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | @endforeach
34 |
35 |
36 |
37 |
38 |
39 |
53 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/highlight.blade.php:
--------------------------------------------------------------------------------
1 | {{ $slot }}
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/arrow-circle-left.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/arrow-left.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/arrow-right.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/check-circle.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/chevron-down.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/chevron-up.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/cog.blade.php:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/copy.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/excel.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/trash.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/icons/x-circle.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/link.blade.php:
--------------------------------------------------------------------------------
1 | {{ $slot }}
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/tailwind-pagination.blade.php:
--------------------------------------------------------------------------------
1 |
51 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/tailwind-simple-pagination.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | @if ($paginator->onFirstPage())
4 |
5 |
6 | {{ __('Previous')}}
7 |
8 | @else
9 |
13 | @endif
14 |
15 |
16 |
17 | @if ($paginator->hasMorePages())
18 |
22 | @else
23 |
24 | {{ __('Next')}}
25 |
26 |
27 | @endif
28 |
29 |
--------------------------------------------------------------------------------
/resources/views/livewire/datatables/tooltip.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {{ Str::limit($slot, $length) }}
3 | {{ $slot }}
4 |
--------------------------------------------------------------------------------
/resources/views/relation.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('title', 'Relation')
3 | @section('content')
4 |
5 |
Complex
6 |
7 |
8 |
9 |
10 | @verbatim
11 |
12 | @endverbatim
13 |
14 |
15 |
16 |
17 |
18 | @endsection
19 |
--------------------------------------------------------------------------------
/resources/views/show-email.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {{ $value }}
3 | {{ $row }}
4 |
--------------------------------------------------------------------------------
/resources/views/simple.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('title', 'Simple')
3 | @section('content')
4 |
5 |
Simple
6 |
7 |
8 |
9 |
10 | @verbatim
11 |
12 | @endverbatim
13 |
14 |
15 | @endsection
--------------------------------------------------------------------------------
/resources/views/table-actions.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 | {{ $name }}
13 |
14 |
15 | @include('datatables::delete', ['value' => $id])
16 |
17 |
--------------------------------------------------------------------------------
/routes/api.php:
--------------------------------------------------------------------------------
1 | get('/user', function (Request $request) {
18 | return $request->user();
19 | });
20 |
--------------------------------------------------------------------------------
/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
--------------------------------------------------------------------------------
/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
19 | })->describe('Display an inspiring quote');
20 |
--------------------------------------------------------------------------------
/routes/web.php:
--------------------------------------------------------------------------------
1 | name('home');
9 |
10 | Route::view('/simple', 'simple')->name('simple');
11 | Route::view('/intermediate', 'intermediate')->name('intermediate');
12 | Route::view('/complex', 'complex')->name('complex');
13 | Route::view('/relation', 'relation')->name('relation');
14 | Route::view('/actions', 'actions')->name('actions');
15 | Route::view('/deletable', 'deletable')->name('deletable');
16 |
17 | Route::middleware('guest')->group(function () {
18 | Route::view('login', 'auth.login')->name('login');
19 | Route::view('register', 'auth.register')->name('register');
20 | });
21 |
22 | Route::get('user/{user}', function ($user) {
23 | return response()->json($user);
24 | })->name('users.show');
25 |
26 | Route::get('user/{user}/edit', function (User $user) {
27 | return response()->json($user);
28 | })->name('users.edit');
29 |
30 | Route::delete('user/{user}', function ($user) {
31 | return response()->json($user);
32 | })->name('users.delete');
33 |
34 | Route::view('password/reset', 'auth.passwords.email')->name('password.request');
35 | Route::get('password/reset/{token}', 'Auth\PasswordResetController')->name('password.reset');
36 |
37 | Route::middleware('auth')->group(function () {
38 | Route::view('email/verify', 'auth.verify')->middleware('throttle:6,1')->name('verification.notice');
39 | Route::get('email/verify/{id}/{hash}', 'Auth\EmailVerificationController')->middleware('signed')->name('verification.verify');
40 |
41 | Route::post('logout', 'Auth\LogoutController')->name('logout');
42 |
43 | Route::view('password/confirm', 'auth.passwords.confirm')->name('password.confirm');
44 | });
45 |
--------------------------------------------------------------------------------
/server.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | $uri = urldecode(
11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
12 | );
13 |
14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the
15 | // built-in PHP web server. This provides a convenient way to test a Laravel
16 | // application without having installed a "real" web server software here.
17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
18 | return false;
19 | }
20 |
21 | require_once __DIR__.'/public/index.php';
22 |
--------------------------------------------------------------------------------
/storage/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MedicOneSystems/demo-livewire-datatables/9e7d0dad337ed2b50e23a1b7c01abee7ae45dece/storage/.DS_Store
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/debugbar/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | config.php
2 | routes.php
3 | schedule-*
4 | compiled.php
5 | services.json
6 | events.scanned.php
7 | routes.scanned.php
8 | down
9 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | const defaultTheme = require('tailwindcss/defaultTheme');
2 |
3 | module.exports = {
4 | mode: 'jit',
5 | theme: {
6 | extend: {
7 | fontFamily: {
8 | sans: ['Inter var', ...defaultTheme.fontFamily.sans],
9 | },
10 | },
11 | },
12 | purge: [
13 | './app/**/*.php',
14 | './vendor/laravel/jetstream/**/*.blade.php',
15 | './vendor/mediconesystems/**/*.blade.php',
16 | './storage/framework/views/*.php',
17 | './resources/views/**/*.blade.php',
18 | './app/Providers/AppServiceProvider.php',
19 | ],
20 | plugins: [
21 | require('@tailwindcss/forms'),
22 | ],
23 | };
24 |
--------------------------------------------------------------------------------
/tests/CreatesApplication.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/LoginTest.php:
--------------------------------------------------------------------------------
1 | get(route('login'))
20 | ->assertSuccessful()
21 | ->assertSeeLivewire('auth.login');
22 | }
23 |
24 | /** @test */
25 | public function is_redirected_if_already_logged_in()
26 | {
27 | $user = factory(User::class)->create();
28 |
29 | $this->be($user);
30 |
31 | $this->get(route('login'))
32 | ->assertRedirect(route('home'));
33 | }
34 |
35 | /** @test */
36 | public function a_user_can_login()
37 | {
38 | $user = factory(User::class)->create(['password' => Hash::make('password')]);
39 |
40 | Livewire::test('auth.login')
41 | ->set('email', $user->email)
42 | ->set('password', 'password')
43 | ->call('authenticate');
44 |
45 | $this->assertAuthenticatedAs($user);
46 | }
47 |
48 | /** @test */
49 | public function is_redirected_to_the_home_page_after_login()
50 | {
51 | $user = factory(User::class)->create(['password' => Hash::make('password')]);
52 |
53 | Livewire::test('auth.login')
54 | ->set('email', $user->email)
55 | ->set('password', 'password')
56 | ->call('authenticate')
57 | ->assertRedirect(route('home'));
58 | }
59 |
60 | /** @test */
61 | public function email_is_required()
62 | {
63 | $user = factory(User::class)->create(['password' => Hash::make('password')]);
64 |
65 | Livewire::test('auth.login')
66 | ->set('password', 'password')
67 | ->call('authenticate')
68 | ->assertHasErrors(['email' => 'required']);
69 | }
70 |
71 | /** @test */
72 | public function email_must_be_valid_email()
73 | {
74 | $user = factory(User::class)->create(['password' => Hash::make('password')]);
75 |
76 | Livewire::test('auth.login')
77 | ->set('email', 'invalid-email')
78 | ->set('password', 'password')
79 | ->call('authenticate')
80 | ->assertHasErrors(['email' => 'email']);
81 | }
82 |
83 | /** @test */
84 | public function password_is_required()
85 | {
86 | $user = factory(User::class)->create(['password' => Hash::make('password')]);
87 |
88 | Livewire::test('auth.login')
89 | ->set('email', $user->email)
90 | ->call('authenticate')
91 | ->assertHasErrors(['password' => 'required']);
92 | }
93 |
94 | /** @test */
95 | public function bad_login_attempt_shows_message()
96 | {
97 | $user = factory(User::class)->create();
98 |
99 | Livewire::test('auth.login')
100 | ->set('email', $user->email)
101 | ->set('password', 'bad-password')
102 | ->call('authenticate')
103 | ->assertHasErrors('email');
104 |
105 | $this->assertFalse(Auth::check());
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/LogoutTest.php:
--------------------------------------------------------------------------------
1 | create();
18 | $this->be($user);
19 |
20 | $this->post(route('logout'))
21 | ->assertRedirect(route('home'));
22 |
23 | $this->assertFalse(Auth::check());
24 | }
25 |
26 | /** @test */
27 | public function an_unauthenticated_user_can_not_log_out()
28 | {
29 | $this->post(route('logout'))
30 | ->assertRedirect(route('login'));
31 |
32 | $this->assertFalse(Auth::check());
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/Passwords/ConfirmTest.php:
--------------------------------------------------------------------------------
1 | middleware(['web', 'password.confirm']);
23 | }
24 |
25 | /** @test */
26 | public function a_user_must_confirm_their_password_before_visiting_a_protected_page()
27 | {
28 | $user = factory(User::class)->create();
29 | $this->be($user);
30 |
31 | $this->get('/must-be-confirmed')
32 | ->assertRedirect(route('password.confirm'));
33 |
34 | $this->followingRedirects()
35 | ->get('/must-be-confirmed')
36 | ->assertSeeLivewire('auth.passwords.confirm');
37 | }
38 |
39 | /** @test */
40 | public function a_user_must_enter_a_password_to_confirm_it()
41 | {
42 | Livewire::test('auth.passwords.confirm')
43 | ->call('confirm')
44 | ->assertHasErrors(['password' => 'required']);
45 | }
46 |
47 | /** @test */
48 | public function a_user_must_enter_their_own_password_to_confirm_it()
49 | {
50 | $user = factory(User::class)->create([
51 | 'password' => Hash::make('password'),
52 | ]);
53 |
54 | Livewire::test('auth.passwords.confirm')
55 | ->set('password', 'not-password')
56 | ->call('confirm')
57 | ->assertHasErrors(['password' => 'password']);
58 | }
59 |
60 | /** @test */
61 | public function a_user_who_confirms_their_password_will_get_redirected()
62 | {
63 | $user = factory(User::class)->create([
64 | 'password' => Hash::make('password'),
65 | ]);
66 |
67 | $this->be($user);
68 |
69 | $this->withSession(['url.intended' => '/must-be-confirmed']);
70 |
71 | Livewire::test('auth.passwords.confirm')
72 | ->set('password', 'password')
73 | ->call('confirm')
74 | ->assertRedirect('/must-be-confirmed');
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/Passwords/EmailTest.php:
--------------------------------------------------------------------------------
1 | get(route('password.request'))
18 | ->assertSuccessful()
19 | ->assertSeeLivewire('auth.passwords.email');
20 | }
21 |
22 | /** @test */
23 | public function a_user_must_enter_an_email_address()
24 | {
25 | Livewire::test('auth.passwords.email')
26 | ->call('sendResetPasswordLink')
27 | ->assertHasErrors(['email' => 'required']);
28 | }
29 |
30 | /** @test */
31 | public function a_user_must_enter_a_valid_email_address()
32 | {
33 | Livewire::test('auth.passwords.email')
34 | ->set('email', 'email')
35 | ->call('sendResetPasswordLink')
36 | ->assertHasErrors(['email' => 'email']);
37 | }
38 |
39 | /** @test */
40 | public function a_user_who_enters_a_valid_email_address_will_get_sent_an_email()
41 | {
42 | $user = factory(User::class)->create();
43 |
44 | Livewire::test('auth.passwords.email')
45 | ->set('email', $user->email)
46 | ->call('sendResetPasswordLink')
47 | ->assertNotSet('emailSentMessage', false);
48 |
49 | $this->assertDatabaseHas('password_resets', [
50 | 'email' => $user->email,
51 | ]);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/Passwords/ResetTest.php:
--------------------------------------------------------------------------------
1 | create();
23 |
24 | $token = Str::random(16);
25 |
26 | DB::table('password_resets')->insert([
27 | 'email' => $user->email,
28 | 'token' => Hash::make($token),
29 | 'created_at' => Carbon::now(),
30 | ]);
31 |
32 | $this->get(route('password.reset', [
33 | 'email' => $user->email,
34 | 'token' => $token,
35 | ]))
36 | ->assertSuccessful()
37 | ->assertSeeLivewire('auth.passwords.reset');
38 | }
39 |
40 | /** @test */
41 | public function can_reset_password()
42 | {
43 | $user = factory(User::class)->create();
44 |
45 | $token = Str::random(16);
46 |
47 | DB::table('password_resets')->insert([
48 | 'email' => $user->email,
49 | 'token' => Hash::make($token),
50 | 'created_at' => Carbon::now(),
51 | ]);
52 |
53 | Livewire::test('auth.passwords.reset', [
54 | 'token' => $token,
55 | ])
56 | ->set('email', $user->email)
57 | ->set('password', 'new-password')
58 | ->set('passwordConfirmation', 'new-password')
59 | ->call('resetPassword');
60 |
61 | $this->assertTrue(Auth::attempt([
62 | 'email' => $user->email,
63 | 'password' => 'new-password',
64 | ]));
65 | }
66 |
67 | /** @test */
68 | public function token_is_required()
69 | {
70 | Livewire::test('auth.passwords.reset', [
71 | 'token' => null,
72 | ])
73 | ->call('resetPassword')
74 | ->assertHasErrors(['token' => 'required']);
75 | }
76 |
77 | /** @test */
78 | public function email_is_required()
79 | {
80 | Livewire::test('auth.passwords.reset', [
81 | 'token' => Str::random(16),
82 | ])
83 | ->set('email', null)
84 | ->call('resetPassword')
85 | ->assertHasErrors(['email' => 'required']);
86 | }
87 |
88 | /** @test */
89 | public function email_is_valid_email()
90 | {
91 | Livewire::test('auth.passwords.reset', [
92 | 'token' => Str::random(16),
93 | ])
94 | ->set('email', 'email')
95 | ->call('resetPassword')
96 | ->assertHasErrors(['email' => 'email']);
97 | }
98 |
99 | /** @test */
100 | function password_is_required()
101 | {
102 | Livewire::test('auth.passwords.reset', [
103 | 'token' => Str::random(16),
104 | ])
105 | ->set('password', '')
106 | ->call('resetPassword')
107 | ->assertHasErrors(['password' => 'required']);
108 | }
109 |
110 | /** @test */
111 | function password_is_minimum_of_eight_characters()
112 | {
113 | Livewire::test('auth.passwords.reset', [
114 | 'token' => Str::random(16),
115 | ])
116 | ->set('password', 'secret')
117 | ->call('resetPassword')
118 | ->assertHasErrors(['password' => 'min']);
119 | }
120 |
121 | /** @test */
122 | function password_matches_password_confirmation()
123 | {
124 | Livewire::test('auth.passwords.reset', [
125 | 'token' => Str::random(16),
126 | ])
127 | ->set('password', 'new-password')
128 | ->set('passwordConfirmation', 'not-new-password')
129 | ->call('resetPassword')
130 | ->assertHasErrors(['password' => 'same']);
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/RegisterTest.php:
--------------------------------------------------------------------------------
1 | get(route('register'))
21 | ->assertSuccessful()
22 | ->assertSeeLivewire('auth.register');
23 | }
24 |
25 | /** @test */
26 | public function is_redirected_if_already_logged_in()
27 | {
28 | $user = factory(User::class)->create();
29 |
30 | $this->be($user);
31 |
32 | $this->get(route('register'))
33 | ->assertRedirect(route('home'));
34 | }
35 |
36 | /** @test */
37 | function a_user_can_register()
38 | {
39 | Livewire::test('auth.register')
40 | ->set('name', 'Tall Stack')
41 | ->set('email', 'tallstack@example.com')
42 | ->set('password', 'password')
43 | ->set('passwordConfirmation', 'password')
44 | ->call('register')
45 | ->assertRedirect(route('home'));
46 |
47 | $this->assertTrue(User::whereEmail('tallstack@example.com')->exists());
48 | $this->assertEquals('tallstack@example.com', Auth::user()->email);
49 | }
50 |
51 | /** @test */
52 | function name_is_required()
53 | {
54 | Livewire::test('auth.register')
55 | ->set('name', '')
56 | ->call('register')
57 | ->assertHasErrors(['email' => 'required']);
58 | }
59 |
60 | /** @test */
61 | function email_is_required()
62 | {
63 | Livewire::test('auth.register')
64 | ->set('email', '')
65 | ->call('register')
66 | ->assertHasErrors(['email' => 'required']);
67 | }
68 |
69 | /** @test */
70 | function email_is_valid_email()
71 | {
72 | Livewire::test('auth.register')
73 | ->set('email', 'tallstack')
74 | ->call('register')
75 | ->assertHasErrors(['email' => 'email']);
76 | }
77 |
78 | /** @test */
79 | function email_hasnt_been_taken_already()
80 | {
81 | factory(User::class)->create(['email' => 'tallstack@example.com']);
82 |
83 | Livewire::test('auth.register')
84 | ->set('email', 'tallstack@example.com')
85 | ->call('register')
86 | ->assertHasErrors(['email' => 'unique']);
87 | }
88 |
89 | /** @test */
90 | function see_email_hasnt_already_been_taken_validation_message_as_user_types()
91 | {
92 | factory(User::class)->create(['email' => 'tallstack@example.com']);
93 |
94 | Livewire::test('auth.register')
95 | ->set('email', 'smallstack@gmail.com')
96 | ->assertHasNoErrors()
97 | ->set('email', 'tallstack@example.com')
98 | ->call('register')
99 | ->assertHasErrors(['email' => 'unique']);
100 | }
101 |
102 | /** @test */
103 | function password_is_required()
104 | {
105 | Livewire::test('auth.register')
106 | ->set('password', '')
107 | ->set('passwordConfirmation', 'password')
108 | ->call('register')
109 | ->assertHasErrors(['password' => 'required']);
110 | }
111 |
112 | /** @test */
113 | function password_is_minimum_of_eight_characters()
114 | {
115 | Livewire::test('auth.register')
116 | ->set('password', 'secret')
117 | ->set('passwordConfirmation', 'secret')
118 | ->call('register')
119 | ->assertHasErrors(['password' => 'min']);
120 | }
121 |
122 | /** @test */
123 | function password_matches_password_confirmation()
124 | {
125 | Livewire::test('auth.register')
126 | ->set('email', 'tallstack@example.com')
127 | ->set('password', 'password')
128 | ->set('passwordConfirmation', 'not-password')
129 | ->call('register')
130 | ->assertHasErrors(['password' => 'same']);
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/VerifyTest.php:
--------------------------------------------------------------------------------
1 | create([
24 | 'email_verified_at' => null,
25 | ]);
26 |
27 | Auth::login($user);
28 |
29 | $this->get(route('verification.notice'))
30 | ->assertSuccessful()
31 | ->assertSeeLivewire('auth.verify');
32 | }
33 |
34 | /** @test */
35 | public function can_resend_verification_email()
36 | {
37 | $user = factory(User::class)->create();
38 |
39 | Livewire::actingAs($user);
40 |
41 | Livewire::test('auth.verify')
42 | ->call('resend')
43 | ->assertEmitted('resent');
44 | }
45 |
46 | /** @test */
47 | public function can_verify()
48 | {
49 | $user = factory(User::class)->create([
50 | 'email_verified_at' => null,
51 | ]);
52 |
53 | Auth::login($user);
54 |
55 | $url = URL::temporarySignedRoute('verification.verify', Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)), [
56 | 'id' => $user->getKey(),
57 | 'hash' => sha1($user->getEmailForVerification()),
58 | ]);
59 |
60 | $this->get($url)
61 | ->assertRedirect(route('home'));
62 |
63 | $this->assertTrue($user->hasVerifiedEmail());
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get(route('home'))->assertSuccessful();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | swap(Mix::class, function () {
20 | return '';
21 | });
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/Unit/ExampleTest.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/vapor.yml:
--------------------------------------------------------------------------------
1 | id: 11545
2 | name: demo-livewire-datatables
3 | environments:
4 | production:
5 | database: livewire-datatables-db
6 | domain: livewire-datatables.com
7 | memory: 1024
8 | cli-memory: 512
9 | runtime: php-7.4
10 | storage: livewire-datatables
11 | build:
12 | - 'composer install --no-dev'
13 | - 'php artisan event:cache'
14 |
--------------------------------------------------------------------------------
/webpack.mix.js:
--------------------------------------------------------------------------------
1 | const mix = require("laravel-mix");
2 |
3 | require("laravel-mix-tailwind");
4 |
5 | mix.js("resources/js/app.js", "public/js/app.js")
6 | .sass("resources/sass/app.scss", "public/css/app.css")
7 | .tailwind("./tailwind.config.js")
8 | .sourceMaps()
9 | .browserSync({
10 | proxy: 'https://demo-livewire-datatables.test',
11 | https: true,
12 | });
13 |
14 | if (mix.inProduction()) {
15 | mix.version();
16 | }
17 |
--------------------------------------------------------------------------------