title: Best practice for implementing frontend using laravel and vue
body: <p>I'm developing a large scale application base on Laravel 5.4. I'm wondering what is the best practice for implementing fronend for large scale application? Implementing on laravel blade for all styling and html rendering and using vue for interactivity or using blade to call vue components and implementing all stuff is vue? Let's see some examples:</p>
  
  <p><strong>This is first approach:</strong></p>
  
  <p>In laravel blade:</p>
  
  <pre><code>@extends('layout')
  @section('content')
    &lt;customer-search&gt;&lt;/customer-search&gt;
    &lt;customer-table&gt;&lt;/customer-table&gt;
  @endsection
  </code></pre>
  
  <p>then customer-search component would be:</p>
  
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;form action="/customer" method="GET"&gt;
        &lt;input type="text" name="name" @input="updateValue($event.target.value)" :value="name" /&gt;
        &lt;submit @click="search"&gt;Search&lt;/button&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
    export default {
      data: function () {
        return {
          name: '',
        }
      },
      methods: {
        search() {
          // Get data from server, update related data model for using in customer table, ...
        }
      }
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>and customer-table component:</p>
  
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;table&gt;
        &lt;thead&gt;
          &lt;tr&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;th&gt;Access&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
          &lt;tr v-for="customer in customers"&gt;
            &lt;td&gt;{{ customer.name }}&lt;/td&gt;
            &lt;td&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
    export default {
  
    }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Second approach:</strong>
  blade:</p>
  
  <pre><code>@extends('layout')
  @section('content')
    &lt;customer-index&gt;
      &lt;form action="/customer" method="GET"&gt;
        &lt;input type="text" name="name" @input="updateValue($event.target.value)" :value="name" /&gt;
        &lt;submit @click="search"&gt;Search&lt;/button&gt;
      &lt;/form&gt;
  
      &lt;table&gt;
        &lt;thead&gt;
          &lt;tr&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;th&gt;Access&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
          &lt;tr v-for="customer in customers"&gt;
            &lt;td&gt;{{ customer.name }}&lt;/td&gt;
            &lt;td&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/customer-index&gt;
  @endsection
  </code></pre>
  
  <p>and customer-index component:</p>
  
  <pre><code>&lt;tempalte&gt;
    &lt;div&gt;
      &lt;slot&gt;&lt;/slot&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
    export default {
      data: function () {
        return {
          name: '',
        }
      },
      methods: {
        search() {
          // Get data from server, update related data model for using in customer table, ...
        },
        // Other methods, ...
      }
    }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Third possibility:</strong>
  Third possibility is try to using second approach and go more in depth on components. For example using a component for tables, a component for forms, a component for inputs, a component for buttons, ...
  Which one should i use to avid spending much time in fronend and also have a integrated frontend?</p>