I did some test but rather than getting text back from this:
$slice = Str::of('This is my name')->after('This is');
I get back:
And when I try to return its value in a JSON response $slice is empty
In my controller I have
use Illuminate\Support\Str; $slice = Str::of('This is my name')->after('This is'); return response()->json([ 'data' => ['text' => $slice] ], 200);
But the JSON response data is empty.
Any pointers will be greatly appreciated