protected function checkIfReservedWordInUrl($url = false)
    {
        $sections = $this->getCurrentUrlSections();
        if (count($sections) >= 1) {
            $last = intval($sections[count($sections) - 1]);
        }

        $keywords = [
            'show',
            'create',
            'edit',
        ];

        foreach ($sections as $key => $slug) {
            if (in_array($slug, $keywords)) {
                return $slug;
            }
        }

        // resource ID
        if ($last >= 1) {
            return 'show';
        }

        return false;
    }
protected function checkIfReservedWordInUrl($url = false)
    {
        $sections = $this->getCurrentUrlSections();
        if (count($sections) >= 1) {
            $last = intval($sections[count($sections) - 1]);
        }

        $keywords = [
            'show',
            'create',
            'edit',
        ];

        foreach ($sections as $key => $slug) {
            if (in_array($slug, $keywords)) {
                return $slug;
            }
        }

        // resource ID
        if ($last >= 1) {
            return 'show';
        }

        return false;
    }
protected function checkIfReservedWordInUrl ( $ url = false ) { $ sections = $ this -> getCurrentUrlSections ( ) ; if ( count ( $ sections ) >= 1 ) { $ last = intval ( $ sections [ count ( $ sections ) - 1 ] ) ; } $ keywords = [ 'show' , 'create' , 'edit' , ] ; foreach ( $ sections as $ key => $ slug ) { if ( in_array ( $ slug , $ keywords ) ) { return $ slug ; } } // resource ID if ( $ last >= 1 ) { return 'show' ; } return false ; }
Check if one of the keywords are in the url

@param bool $url
@return bool
Check if one of the keywords are in the url