Skip to content

Commit

Permalink
[5.7] Tidy up for artisan preset command (#26244)
Browse files Browse the repository at this point in the history
* [5.7] Update vue version to 2.5.17

* [5.7] Fix for preset none command still requiring bootstrap
  • Loading branch information
michaelmano authored and taylorotwell committed Oct 25, 2018
1 parent 5298408 commit 005b44d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Illuminate/Foundation/Console/Presets/None.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ protected static function updateBootstrapping()
{
file_put_contents(resource_path('sass/app.scss'), ''.PHP_EOL);
copy(__DIR__.'/none-stubs/app.js', resource_path('js/app.js'));
copy(__DIR__.'/none-stubs/bootstrap.js', resource_path('js/bootstrap.js'));
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/Presets/Vue.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function install()
*/
protected static function updatePackageArray(array $packages)
{
return ['vue' => '^2.5.7'] + Arr::except($packages, [
return ['vue' => '^2.5.17'] + Arr::except($packages, [
'babel-preset-react',
'react',
'react-dom',
Expand Down
43 changes: 43 additions & 0 deletions src/Illuminate/Foundation/Console/Presets/none-stubs/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

window._ = require('lodash');

/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/

window.axios = require('axios');

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

/**
* Next we will register the CSRF Token as a common header with Axios so that
* all outgoing HTTP requests automatically have it attached. This is just
* a simple convenience so we don't have to attach every token manually.
*/

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/

// import Echo from 'laravel-echo'

// window.Pusher = require('pusher-js');

// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// encrypted: true
// });

0 comments on commit 005b44d

Please sign in to comment.