Hi there,
I am very new to this Laravel stuff, so, please make any replies as basic as possible.
I am trying to add tabs to the settings screen in Laravel Spark. I have followed most of the steps found at a different discussion on the same subject found here: https://laracasts.com/discuss/channels/spark/adding-a-settings-tab?page=0 in the following fashion:
1.) I edited the resources/views/vendor/spark/settings.blade.php file and added:
<!-- New Tab -->
<div class="panel panel-default panel-flush">
<div class="panel-heading">
New Tab Heading
</div>
<div class="panel-body">
<div class="spark-settings-tabs">
<ul class="nav spark-settings-stacked-tabs" role="tablist">
<!-- List Something Link -->
<li role="presentation">
<a href="#something" aria-controls="something" role="tab" data-toggle="tab">
<i class="fa fa-fw fa-btn fa-something"></i>List Something
</a>
</li>
</ul>
</div>
</div>
</div>
and further down, within the tab-content div.
<!-- Add Something -->
<div role="tabpanel" class="tab-pane" id="something">
@include('spark::settings.addsomething')
</div>
2.) I created a new file resources/views/vendor/spark/settings/addsomething.blade.php the contents of which are as follows:
<spark-addsomething :user="user" inline-template>
<div>
<!-- Add a Tool -->
@include('spark::settings.addsomething.include-something')
</div>
</spark-addsomething>
3.) I created another new file at resources/views/vendor/spark/settings/addsomething called include-something.blade.php the contents of which so far are just:
<spark-include-something :user="user" inline-template>
<div>
<div class="panel panel-default" v-if="user">
<div class="panel-heading">Add Something</div>
</div>
</div>
</spark-include-something>
4.) Realising I needed to update some JS components, under resources/assets/js/spark-components/settings I have created new files and directories. At this level, I created a file called addsomething.js the contents of which are:
var base = require('settings/addsomething');
Vue.component('spark-addsomething', {
mixins: [base]
});
In a new directory resources/assets/js/spark-components/settings/addsomething I created a file include-something.js which looks like this:
var base = require('settings/adsomething/include-something');
Vue.component('spark-include-something', {
mixins: [base]
});
5.) The last file I updated was resources/assets/js/spark-components/bootstrap.js where I included the following lines:
/**
* Add Something Components...
*/
require('./settings/addsomething');
require('./settings/addsomething/include-something');
After all that, I went to the Command Line Editor - I'm using PuTTY - and ran the gulp command. Unfortunately, this resulted in the errors:
[Error: Cannot find module 'settings/addsomething/include-something' from '/var/www/vhosts/example.co.uk/laravel/resources/assets/js/spark-components/settings/addsomething']
and
[Error: Cannot find module 'settings/addsomething' from '/var/www/vhosts/example.co.uk/laravel/resources/assets/js/spark-components/settings']
Apologies for the rather long question - I wanted to give as much info on what I had done so far - and I realise I might be missing a step or two, but, sadly, have no idea what I need to do in order to get this working.
Any help that anyone can provide would be most appreciated, but please, keep your responses basic. As A.A.Milne wrote
I am a Bear of Very Little Brain, and long words Bother Me
Also, if you require any further information before you answer, please don't hesitate to ask.
With kind regards,
Mark