$ laravel new jot
$ php artisan (help) make:auth
$ php artisan (help) preset
$ php artisan preset none
- clear preset (jquery, vue & bootstrap)$ php artisan preset vue
- use Vue only$ npm install vue-router tailwindcss --save-dev
Prepare laravel to be used for SPA
Keep the auth endpoints, route everything else to AppController@index
, then
in web.php
do: Route::get('/{any}, 'AppController@index')->where('any', '.*')
Next in the main view of the application add <App />
Vue component, then register
it in the Vue components folder. Edit app.js
and make router.js
:
import Vue from 'vue';
import router from './router.js';
import App from './components/App';
require('./bootstrap');
const app = new Vue({
el: '#app',
components: {
App
}
router
});
import Vue from 'vue';
import VueRouter from 'vue-router';
import ExampleComponent from './components/ExampleComponent'
Vue.use(VueRouter);
export default new VueRouter({
routes: [
{ path: '/', component: ExampleComponent }
]
mode: 'history' // will turn OFF old browser support
});
Use <router-view>
in the main component <App />
to display the routed components.
Important to note: the auth routes will be handled by laravel...
Go to tailwindcss.com - docs - installation for more information.
$ npm install tailwindcss --save
app.scss
file & do the configuration.Nice introduction to TDD in Laravel with PHPUNIT e08, e09 & e10!
phpunit.xml
and add:
<server name="DB_CONNECTION" value="sqlite">
<server name="DB_DATABASE" value=":memory:">
The wireless range offered by your Internet router will vary depending on which Wi-Fi standard it supports (802.11n routers are better than Wireless-G routers) and also the router’s physical location. You may have bought a new Wireless-N or Wireless-AC router but if there are any thick walls around, they will obstruct the Wi-Fi signal.
Eloquent ORM seems like a simple mechanism, but under the hood, there’s a lot of semi-hidden functions and less-known ways to achieve more with it. In this article, I will show you a few tricks.
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart.
To help improve performance, any route can be lazily-loaded by embracing Vue's async components and webpack's code-splitting feature. Don't worry: I hate confusing jargon, too. Let's break it down and review exactly when and why you might consider lazy loading certain routes in your app.
View the source code for this episode on GitHub.