I'm wondering if it is worth moving from this code.
@extends('layouts.app')
@section('title', 'Page Title')
@section('content')
@foreach ($tasks as $task)
{{ $task }}
@endforeach
@endsection
To this one.
<x-layout>
<x-slot:title>
Custom Title
</x-slot>
@foreach ($tasks as $task)
{{ $task }}
@endforeach
</x-layout>
I mean is it better to use Laravel components instead of just using @extend, @yeild, and @section etc..
@foreach
you are still following blade pattern which is inconsistent to the vue template. so, IMO it's not wise now to move it from blade to vue. when all the directives are available in vue component, you can slowly migrate to those. – Reduced@functions()
) but for blade-x, i dont think all the directives are available as it's quite recent (<x-directives>
) and also, blade-x is not supported for type hinting and code suggestions in most of the IDEs – Reduced