Example code here. <? php namespace App \ Http \ Controllers ; use Illuminate \ Http \ Request ; use Illuminate \ Support \ Str ; class CollectionController extends Controller { const PROJECT_TYPES = [ 'action' , 'base resource' , 'A W S' , 'lara beans' ]; const MOVIES_TYPES = [ [ 'id' => 1 , 'name' => 'action' ], [ 'id' => 2 , 'name' => 'base resource' ], [ 'id' => 3 , 'name' => 'A W S' ], [ 'id' => 4 , 'name' => 'lara beans' ] ]; function mapWithSlugs () { dump ( 'Convert name of arrays into slug using Slug function and iterate array with map function' ); $slugs = []; foreac...