-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from laravel-frontend-presets/chore/laravel-6-c…
…ompat Update for Laravel 6
- Loading branch information
Showing
11 changed files
with
182 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
41 changes: 41 additions & 0 deletions
41
src/inertiajs-stubs/providers/InertiaJsServiceProvider.stub
This file contains 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,41 @@ | ||
<?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() | ||
{ | ||
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 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 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 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 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 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 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); | ||
} |