I want to declare the value inside the include
, so that later I can call it in the file itself
First I do this
@include('components.protected-email', ['key' => 'emails[0]'])
and in the file itself
@php
$split = explode('@', $key);
$first = $split[0];
$second = $split[1];
@endphp
<a href="" data-first="{{ $first }}" data-second="{{ $second }}" class="js-combaine-email"></a>
But I get the error
ErrorException Undefined offset: 1 (View: D:\wamp64\www\test\resources\views\components\protected-email.blade.php)