class

Analyzer::Php::Folio

Inherits Analyzer::Php::PhpEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Laravel Folio maps Blade views under a mounted directory to GET routes:

Folio::path(resource_path('views/pages'))->uri('/')->middleware([
    'admin/*' => ['auth'],
]);

pages/users/index.blade.php   → GET /users
pages/users/[User].blade.php  → GET /users/{user}
pages/docs/[...slug].blade.php → GET /docs/{slug}

Mounts come from Folio::path(...) chains in service providers; with none found the installer default (resources/views/pages at /) is used. Middleware from the mount's pattern map and from the page's own middleware([...]) call is reported as a tag.

Constants

DEFAULT_DIR = "resources/views/pages"
DYNAMIC_SEGMENT_RE = /\A\[(?:\.\.\.)?([^\]:]+)(?::[^\]]*)?\]\z/
MOUNT_MIDDLEWARE_RE = /->\s*middleware\s*\(\s*\[/
PAGE_MIDDLEWARE_RE = /(?<![\w>:$])middleware\s*\(\s*(\[[^\]]*\]|'[^']*'|"[^"]*")/
PATH_CALL_RE = /\bFolio::(?:domain\s*\(\s*(?:'[^']*'|"[^"]*")\s*\)\s*->\s*)?path\s*\(\s*(resource_path|base_path|app_path)\s*\(\s*['"]([^'"]*)['"]\s*\)/

Folio::path(...), or Folio::domain('admin.example.com')->path(...) for a subdomain mount.

PATH_HELPER_PREFIXES = {"resource_path" => "resources", "base_path" => "", "app_path" => "app"}
PATTERN_ENTRY_RE = /['"]([^'"]+)['"]\s*=>\s*(\[[^\]]*\]|'[^']*'|"[^"]*")/
STRING_RE = /'([^']*)'|"([^"]*)"/
TAGGER = "folio_analyzer"
URI_RE = /->\s*uri\s*\(\s*['"]([^'"]*)['"]/

Class methods

tech_name
Source

Instance methods

analyze
Source
analyze_file(path : String) : Array(Endpoint)
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source

Nested types