Skip to content

Commit 64f07a6

Browse files
author
alokVishu
committed
feat(jetstream): jetstream scaffolding and command updated
1 parent be4f30a commit 64f07a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3107
-1
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
/.idea
3+
/node_modules
4+
/vendor
5+
.phpunit.result.cache
6+
composer.lock
7+
mix-manifest.json
8+
npm-debug.log
9+
package-lock.json

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Themeselection
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+171-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,171 @@
1-
# master-laravel-bootstrap-jetstream
1+
# master-laravel-bootstrap-jetstream
2+
3+
[![Latest Stable Version](https://poser.pugx.org/themeselection/master-laravel-bootstrap-jetstream/v)](//packagist.org/packages/themeselection/master-laravel-bootstrap-jetstream)
4+
[![License](https://poser.pugx.org/themeselection/master-laravel-bootstrap-jetstream/license)](//packagist.org/packages/themeselection/master-laravel-bootstrap-jetstream)
5+
6+
##### Specially customized Laravel jetstream's scaffolding for [Master admin Template](#). It'll not work with any other project.
7+
[Download from packagist](https://packagist.org/packages/themeselection/master-laravel-bootstrap-jetstream)
8+
9+
## Description
10+
11+
Laravel Jetstream is designed using Tailwind CSS and offers your choice of Livewire or Inertia scaffolding. We have removed the Tailwind CSS dependency and modified the Livewire scaffolding as per our template. __Please note we have not provided Inertia scaffolding yet. This package only works with livewire scaffolding__.
12+
13+
Master Laravel Jetsream is a lightweight laravel 8 package that focuses on the `VIEW` side of [Jetstream](https://github.com/laravel/jetstream) package installed in your Laravel application, so when a swap is performed, the `Action`, `MODEL`, `CONTROLLER`, `Component` and `Action` classes of your project is still 100% handled by Laravel development team with no added layer of complexity.
14+
15+
## Table of Content
16+
17+
* [Installation](#installation)
18+
19+
* [Installing Jetstream](#installing-jetstream)
20+
21+
* [Install Jetstream With Livewire](#install-jetstream-with-livewire)
22+
23+
* [Install Master Laravel Bootstrap Jetsream](#install-master-laravel-bootstrap-jetstream)
24+
25+
* [Finalizing The Installation](#finalizing-the-installation)
26+
27+
* [Extras](#extras)
28+
29+
* [Pagination](#pagination)
30+
31+
* [License](#license)
32+
33+
## Installation
34+
35+
### Installing Jetstream
36+
37+
You may use Composer to install Jetstream into your new Laravel project:
38+
39+
```
40+
composer require laravel/jetstream
41+
42+
```
43+
44+
If you choose to install Jetstream through Composer, you should run the jetstream:install Artisan command. This command accepts the name of the stack you prefer (livewire). You are highly encouraged to read through the entire documentation of Livewire before beginning your Jetstream project. In addition, you may use the __--teams__ switch to enable team support:
45+
46+
#### Install Jetstream With Livewire
47+
48+
```bash
49+
// without teams support
50+
51+
php artisan jetstream:install livewire
52+
53+
or
54+
55+
// with teams support
56+
57+
php artisan jetstream:install livewire --teams
58+
59+
```
60+
61+
### Install Master Laravel Bootstrap Jetstream
62+
63+
Use Composer to install Master Jetstream into your new Laravel project as dev dependency:
64+
65+
```
66+
67+
composer require themeselection/master-laravel-bootstrap-jetstream --dev
68+
69+
70+
```
71+
72+
Regardless how you install Jetstream, Master Laravel Bootstrap Jetstream commands are very similar to that
73+
74+
of Jetstream as it accepts the name of the stack you would like to swap (livewire).
75+
76+
> It is important you install and configure [Laravel Jetstream](https://github.com/laravel/jetstream) before performing a swap.
77+
78+
You are highly encouraged to read through the entire documentation of [Jetstream](https://jetstream.laravel.com/1.x/introduction.html)
79+
80+
before beginning your Master Laravel Jetsream project. In addition, you may use the `--teams` switch to swap team assets just like you would in Jetstream:
81+
82+
```bash
83+
// without teams support
84+
85+
php artisan jetstream_master:swap livewire
86+
87+
88+
or
89+
90+
// with teams support
91+
92+
php artisan jetstream_master:swap livewire --teams
93+
94+
```
95+
96+
This will publish overrides to enable Bootstrap like the good old days!
97+
98+
### Finalizing The Installation
99+
100+
After installing Master jetstream and swapping Jetstream resources, remove tailwindCSS and its dependencies if any from your package.json and then install and build your NPM dependencies and migrate your database:
101+
102+
```
103+
104+
npm install && npm run dev
105+
106+
or
107+
108+
yarn && yarn dev
109+
110+
111+
php artisan migrate
112+
113+
```
114+
115+
### Extras
116+
117+
#### Pagination
118+
119+
It is also important to point out that Laravel 8 still includes pagination views built using Bootstrap CSS. To use these views instead of the default Tailwind views, you may call the paginator's useBootstrap method within your AppServiceProvider:
120+
121+
```php
122+
123+
124+
125+
<?php
126+
127+
128+
namespace App\Providers;
129+
130+
use Illuminate\Support\ServiceProvider;
131+
use Illuminate\Pagination\Paginator;
132+
133+
class AppServiceProvider extends ServiceProvider
134+
{
135+
136+
/**
137+
* Register any application services.
138+
*
139+
* @return void
140+
*/
141+
142+
public function register()
143+
{
144+
145+
//
146+
147+
}
148+
149+
/**
150+
* Bootstrap any application services.
151+
* @return void
152+
*/
153+
154+
public function boot()
155+
{
156+
157+
Paginator::useBootstrap();
158+
159+
}
160+
161+
}
162+
163+
```
164+
165+
## Credits
166+
167+
This packages is built on top of [Jetstream](https://github.com/laravel/jetstream) & [Jetstrap](https://github.com/nascent-africa/jetstrap)
168+
169+
## License
170+
171+
Master Jetsream is open-sourced software licensed under the [MIT license](https://github.com/themeselection/master-laravel-bootstrap-jetstream/blob/master/LICENSE).

composer.json

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "themeselection/master-laravel-bootstrap-jetstream",
3+
"description": "A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream to Bootstrap 5.",
4+
"keywords": ["laravel", "bootstrap", "jetstream"],
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Themeselection",
9+
"email": "[email protected]",
10+
"role": "Developer"
11+
}
12+
],
13+
"require": {
14+
"php": "^7.3|^8.0",
15+
"illuminate/support": "^8.0|^9.0"
16+
},
17+
"require-dev": {
18+
"laravel/jetstream": "^2.3",
19+
"orchestra/testbench": "^6.0|^7.0",
20+
"phpunit/phpunit": "^9.3"
21+
},
22+
"autoload": {
23+
"psr-4": {
24+
"Themeselection\\Jetstrap\\": "src/Themeselection/Jetstrap/"
25+
}
26+
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"Themeselection\\Jetstrap\\Tests\\": "tests/"
30+
}
31+
},
32+
"extra": {
33+
"laravel": {
34+
"providers": [
35+
"Themeselection\\Jetstrap\\JetstrapServiceProvider"
36+
],
37+
"aliases": {
38+
"Jetstrap": "Themeselection\\Jetstrap\\JetstrapFacade"
39+
}
40+
}
41+
},
42+
"config": {
43+
"sort-packages": true
44+
},
45+
"minimum-stability": "dev",
46+
"prefer-stable": true,
47+
"scripts": {
48+
"tests": "vendor/bin/phpunit",
49+
"testsVerbose": "@tests -vvv"
50+
}
51+
}

phpunit.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
7+
<testsuites>
8+
<testsuite name="tests">
9+
<directory suffix="Test.php">./tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
</phpunit>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@props(['on'])
2+
3+
<div class="alert alert-success" role="alert" x-data="{ shown: false, timeout: null }"
4+
x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })"
5+
x-show.transition.opacity.out.duration.1500ms="shown" style="display: none;"
6+
{{ $attributes->merge(['class' => 'small']) }}>
7+
<div class="alert-body">
8+
{{ $slot->isEmpty() ? 'Saved.' : $slot }}
9+
</div>
10+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="card">
2+
<h5 class="card-header">
3+
{{ $title }}
4+
</h5>
5+
<div class="card-body">
6+
<p class="card-text text-muted">
7+
{{ $description }}
8+
</p>
9+
{{ $content }}
10+
</div>
11+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<a class="d-flex justify-content-center" href="/">
2+
<span class="app-brand-logo demo bg-primary">
3+
<svg viewBox="0 0 148 80" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="20">
4+
<defs>
5+
<linearGradient id="a1" x1="46.49" x2="62.46" y1="53.39" y2="48.2" gradientUnits="userSpaceOnUse">
6+
<stop stop-opacity=".25" offset="0"></stop>
7+
<stop stop-opacity=".1" offset=".3"></stop>
8+
<stop stop-opacity="0" offset=".9"></stop>
9+
</linearGradient>
10+
<linearGradient id="e2" x1="76.9" x2="92.64" y1="26.38" y2="31.49" xlink:href="#a"></linearGradient>
11+
<linearGradient id="d3" x1="107.12" x2="122.74" y1="53.41" y2="48.33" xlink:href="#a"></linearGradient>
12+
</defs>
13+
<path style="fill: #fff" transform="translate(-.1)" d="M121.36,0,104.42,45.08,88.71,3.28A5.09,5.09,0,0,0,83.93,0H64.27A5.09,5.09,0,0,0,59.5,3.28L43.79,45.08,26.85,0H.1L29.43,76.74A5.09,5.09,0,0,0,34.19,80H53.39a5.09,5.09,0,0,0,4.77-3.26L74.1,35l16,41.74A5.09,5.09,0,0,0,94.82,80h18.95a5.09,5.09,0,0,0,4.76-3.24L148.1,0Z"></path>
14+
<path transform="translate(-.1)" d="M52.19,22.73l-8.4,22.35L56.51,78.94a5,5,0,0,0,1.64-2.19l7.34-19.2Z" fill="url(#a)"></path>
15+
<path transform="translate(-.1)" d="M95.73,22l-7-18.69a5,5,0,0,0-1.64-2.21L74.1,35l8.33,21.79Z" fill="url(#e)"></path>
16+
<path transform="translate(-.1)" d="M112.73,23l-8.31,22.12,12.66,33.7a5,5,0,0,0,1.45-2l7.3-18.93Z" fill="url(#d)"></path>
17+
</svg>
18+
</span>
19+
</a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="container">
2+
<div class="row justify-content-center my-5">
3+
<div class="col-sm-12 col-md-8 col-lg-5 my-4">
4+
<div>
5+
{{ $logo }}
6+
</div>
7+
8+
<div class="card px-1 mx-4">
9+
{{ $slot }}
10+
</div>
11+
</div>
12+
</div>
13+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'btn btn-primary text-uppercase']) }}>
2+
{{ $slot }}
3+
</button>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<input type="checkbox" {!! $attributes->merge(['class' => 'form-check-input']) !!}>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@props(['id' => null, 'maxWidth' => null])
2+
3+
<x-jet-modal :id="$id" :maxWidth="$maxWidth" {{ $attributes }}>
4+
<div class="modal-content">
5+
<div class="modal-header">
6+
<h4 class="modal-title">{{ $title }}</h4>
7+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
8+
</div>
9+
<div class="modal-body">
10+
{{ $content }}
11+
</div>
12+
<div class="modal-footer">
13+
{{ $footer }}
14+
</div>
15+
</div>
16+
</x-jet-modal>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@props(['title' => __('Confirm Password'), 'content' => __('For your security, please confirm your password to continue.'), 'button' => __('Confirm')])
2+
3+
@php
4+
$confirmableId = md5($attributes->wire('then'));
5+
@endphp
6+
7+
<span {{ $attributes->wire('then') }} x-data x-ref="span"
8+
x-on:click="$wire.startConfirmingPassword('{{ $confirmableId }}')"
9+
x-on:password-confirmed.window="setTimeout(() => $event.detail.id === '{{ $confirmableId }}' && $refs.span.dispatchEvent(new CustomEvent('then', { bubbles: false })), 250);">
10+
{{ $slot }}
11+
</span>
12+
13+
@once
14+
<x-jet-dialog-modal wire:model="confirmingPassword">
15+
<x-slot name="title">
16+
{{ $title }}
17+
</x-slot>
18+
19+
<x-slot name="content">
20+
{{ $content }}
21+
22+
<div class="mt-3" x-data="{}"
23+
x-on:confirming-password.window="setTimeout(() => $refs.confirmable_password.focus(), 250)">
24+
<x-jet-input type="password" class="{{ $errors->has('confirmable_password') ? 'is-invalid' : '' }}"
25+
placeholder="{{ __('Password') }}" x-ref="confirmable_password" wire:model.defer="confirmablePassword"
26+
wire:keydown.enter="confirmPassword" />
27+
28+
<x-jet-input-error for="confirmable_password" />
29+
</div>
30+
</x-slot>
31+
32+
<x-slot name="footer">
33+
<x-jet-secondary-button wire:click="stopConfirmingPassword" wire:loading.attr="disabled">
34+
{{ __('Cancel') }}
35+
</x-jet-secondary-button>
36+
37+
<x-jet-button class="ms-1" wire:click="confirmPassword" wire:loading.attr="disabled">
38+
{{ $button }}
39+
</x-jet-button>
40+
</x-slot>
41+
</x-jet-dialog-modal>
42+
@endonce
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<button {{ $attributes->merge(['type' => 'button', 'class' => 'btn btn-danger text-white text-uppercase']) }}>
2+
{{ $slot }}
3+
</button>

0 commit comments

Comments
 (0)