Work perfectly!! TKS!!
Using Foundation Zurb 6.3.0 with Laravel 5.4
Hello,
i will show you how to add Foundation Zurb 6.3.0 to Laravel 5.4 :) !
in empty or new Laravel project do this:
- remove the bootstrap entry from package.json and replace it with:
"foundation-sites": "^6.3.0",
or you can install it from NPM with:
npm install foundation-sites --save-dev
- in resources/assets/sass/app.scss, comment out all the import code. or just remove all the code , and add this:
// Settings
@import "settings";
// Foundation
@import "node_modules/foundation-sites/scss/foundation";
// Include Everything (True) for the Flex Grid :);
@include foundation-everything(true);
-
in resources/assets/js/bootstrap.js, look for
require('bootsrap-sass');and remove it. -
go to this path (with File Explorer) node_modules\foundation-sites\scss\settings and copy the file _settings.scss to the new path resources\assets\sass , and you can remove the _variables.scss file.
-
Open the file _settings.scss in code editor , and change the line 44:
@import 'util/util';
to:
@import "../../../node_modules/foundation-sites/scss/util/util";
- open your file webpack.mix.js in the root of your project. and comment or remove the code:
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
then add this code instead:
mix.sass('resources/assets/sass/app.scss', 'public/css');
mix.combine([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/foundation-sites/dist/js/foundation.min.js'
], 'public/js/app.js');
-
Finally you can run npm command:
npm run devor:npm run watch -
Notice: in your blade Template you still need using the code below because the The Foundation files combine and mixed to this Two Files:
<!-- Scripts -->
<script src="/js/app.js"></script>
and
<!-- Styles -->
<link href="/css/app.css" rel="stylesheet">
- ADD the Initializing code to run JavaScript
<script> $(document).foundation();</script>
- For the .Version() its work only for CSS file. The End :) .
Please or to participate in this conversation.