- Notifications
You must be signed in to change notification settings - Fork 16
Update for Laravel 6 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits Select commit Hold shift + click to select a range
20fc6ed Update for Laravel 6
michaeldyrynda f709391 update readme
michaeldyrynda cb446a8 Add inertiajs/inertia-laravel to composer array
michaeldyrynda f5b8c32 replace Bootstrap with Tailwind
michaeldyrynda bd3851c Publish a service provider to provide default versioning, shared props
michaeldyrynda a45f013 Reorder imports
michaeldyrynda 66537ea Remove unused command variable
michaeldyrynda a8a33b7 Remove extraneous method in default provider
michaeldyrynda 35ead49 consistent naming in reference to service provider
michaeldyrynda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| /public/css | ||
| /public/js | ||
| /public/mix-manifest.json |
46 changes: 46 additions & 0 deletions 46 src/inertiajs-stubs/providers/InertiaJsServiceProvider.stub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <?php | ||
| | ||
| namespace App\Providers; | ||
| | ||
| use Illuminate\Support\Facades\Auth; | ||
| use Illuminate\Support\Facades\Session; | ||
| use Illuminate\Support\ServiceProvider; | ||
| use Inertia\Inertia; | ||
| | ||
| class InertiaJsServiceProvider extends ServiceProvider | ||
| { | ||
| public function register() | ||
| { | ||
| $this->registerInertia(); | ||
| } | ||
| | ||
| protected function registerInertia() | ||
| { | ||
| Inertia::version(function () { | ||
| return md5_file(public_path('mix-manifest.json')); | ||
| }); | ||
| | ||
| Inertia::share([ | ||
| 'auth' => function () { | ||
| return [ | ||
| 'user' => Auth::user() ? [ | ||
| 'id' => Auth::user()->id, | ||
| 'name' => Auth::user()->name, | ||
| 'email' => Auth::user()->email, | ||
| 'avatar' => Auth::user()->avatar(), | ||
| ] : null, | ||
| ]; | ||
| }, | ||
| 'flash' => function () { | ||
| return [ | ||
| 'success' => Session::get('success'), | ||
| ]; | ||
| }, | ||
| 'errors' => function () { | ||
| return Session::get('errors') | ||
| ? Session::get('errors')->getBag('default')->getMessages() | ||
| : (object) []; | ||
| }, | ||
| ]); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,23 @@ | ||
| <template> | ||
| <div> | ||
| <header> | ||
| <nav class="navbar navbar-expand-md navbar-light navbar-laravel"> | ||
| <div class="container"> | ||
| <inertia-link class="navbar-brand" href="/">Inertia.js</inertia-link> | ||
| <div> | ||
| <navbar /> | ||
| | ||
| <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation"> | ||
| <span class="navbar-toggler-icon"></span> | ||
| </button> | ||
| | ||
| <div class="collapse navbar-collapse" id="mainNav"> | ||
| <main> | ||
| <div class="w-full max-w-6xl mx-auto p-4"> | ||
| <article> | ||
| <slot /> | ||
| </article> | ||
| </div> | ||
| </main> | ||
| </div> | ||
| </template> | ||
| | ||
| <ul class="navbar-nav mr-auto"> | ||
| <li class="nav-item"> | ||
| <inertia-link class="nav-link" href="/about">About</inertia-link> | ||
| </li> | ||
| <li class="nav-item"> | ||
| <inertia-link class="nav-link" href="/contact">Contact</inertia-link> | ||
| </li> | ||
| </ul> | ||
| <script> | ||
| import Navbar from '@/Shared/Navbar' | ||
| | ||
| </div> | ||
| </div> | ||
| </nav> | ||
| </header> | ||
| <main class="py-4"> | ||
| <div class="container"> | ||
| <div class="row"> | ||
| <div class="col"> | ||
| <article> | ||
| <slot /> | ||
| </article> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </main> | ||
| </div> | ||
| </template> | ||
| export default { | ||
| components: { | ||
| Navbar, | ||
| } | ||
| } | ||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <template> | ||
| <header class="bg-white shadow"> | ||
| <div class="w-full max-w-6xl mx-auto sm:flex sm:justify-between sm:items-center sm:px-4 sm:py-3"> | ||
| <div class="flex justify-between items-center px-4 py-3 sm:p-0"> | ||
| <div> | ||
| <inertia-link class="navbar-brand" href="/">Inertia.js</inertia-link> | ||
| </div> | ||
| | ||
| <div class="sm:hidden"> | ||
| <button @click="isOpen = !isOpen" type="button" class="block text-gray-700 hover:text-gray-600 focus:text-gray-600 focus:outline-none"> | ||
| <svg class="h-6 w-6 fill-current" viewBox="0 0 24 24"> | ||
| <path v-if="isOpen" fill-rule="evenodd" d="M18.278 16.864a1 1 0 0 1-1.414 1.414l-4.829-4.828-4.828 4.828a1 1 0 0 1-1.414-1.414l4.828-4.829-4.828-4.828a1 1 0 0 1 1.414-1.414l4.829 4.828 4.828-4.828a1 1 0 1 1 1.414 1.414l-4.828 4.829 4.828 4.828z"/> | ||
| <path v-if="!isOpen" fill-rule="evenodd" d="M4 5h16a1 1 0 0 1 0 2H4a1 1 0 1 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2z"/> | ||
| </svg> | ||
| </button> | ||
| </div> | ||
| </div> | ||
| | ||
| <nav :class="isOpen ? 'block' : 'hidden'" class="px-2 pb-4 sm:flex sm:p-0"> | ||
| <inertia-link class="block px-2 py-1 text-gray-700 font-semibold rounded hover:bg-gray-100 focus:bg-gray-100 focus:outline-none" href="/about">About</inertia-link> | ||
| <inertia-link class="mt-1 block px-2 py-1 text-gray-700 font-semibold rounded hover:bg-gray-100 focus:bg-gray-100 focus:outline-none sm:mt-0 sm:ml-2" href="/contact">Contact</inertia-link> | ||
| </nav> | ||
| </div> | ||
| </header> | ||
| </template> | ||
| | ||
| <script> | ||
| export default { | ||
| data() { | ||
| return { | ||
| isOpen: false, | ||
| } | ||
| } | ||
| } | ||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,9 @@ | ||
| | ||
| // Tailwind | ||
| @import url('https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css'); | ||
| | ||
| // Fonts | ||
| @import url('https://fonts.googleapis.com/css?family=Nunito'); | ||
| | ||
| // Variables | ||
| @import 'variables'; | ||
| @import 'nprogress'; | ||
| | ||
| // Bootstrap | ||
| @import '~bootstrap/scss/bootstrap'; | ||
| | ||
| .navbar-laravel { | ||
| background-color: #fff; | ||
| box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.