Home » vue » laravel blade template and vue.js spot combination for layout

laravel blade template and vue.js spot combination for layout

Posted by: admin November 26, 2021 Leave a comment

Questions:

up untill now i used the blade template for making my master layout and i used to make some thing like this code in my layout.blade.php

<div class="m-grid__item m-grid__item--fluid m-wrapper">
        @yield('content')
    </div>

and some thing like this in every other file that i wanted

@extends('layouts.app')

@section('content')

<div class="m-subheader ">


    <div class="d-flex align-items-center">
...

and i made a layout for my admin panel for example but now that i want to use vue.js i want to know how can i make a master template and include other sections and parts and the more important question is should i do it at all or no ?

Answers:

You can use Vue JS components anywhere in your blade layouts.

There is a good example of how to integrate Vue JS components into your Laravel frontend in the Laravel documentation:

https://laravel.com/docs/5.8/frontend

Read the section titled: “Writing Vue Components”