Page Title Component
For understanding, how the component work, please refer to alert components
php artisan make:component pageTitleComponent
We use font-awesome icon in the page title component, hence we need to install font-awesome. For that we first need node js install because of npm package manager. If you do not have node js install in your machine, you can download it from https://nodejs.org/en/ and install it. npm install font-awesome --save
Then in your app.scss which is located inside resources->sass. Add this line to it. @import "node_modules/font-awesome/scss/font-awesome.scss";
Finally you need to run in the Terminal. npm run dev
<div id="pageTitleContainer" class="container-fluid">
<div class="container">
<h1>
@if (session()->has('pageTitleIcon'))
<i class="{{ session('pageTitleIcon') }}"></i>
@endif
@if (session()->has('pageTitle'))
{{ session('pageTitle') }}
@endif
</h1>
</div>
</div>
Nothing is change in page title component class file