# LaravelParser

**Kind:** Class

**Source:** [`atloria-monorepo/libs/parser-core/src/parsers/backend/laravel.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/parsers/backend/laravel.parser.ts#L118)

**Implements:** `IParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `initialize` | `initialize(_config: ParserConfig)` | `Promise<void>` |
| `canParse` | `canParse(filePath: string)` | `boolean` |
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |
| `parseFiles` | `parseFiles(files: ParseFileInput[])` | `Promise<ParseResult[]>` |
| `destroy` | `destroy()` | `Promise<void>` |

## Properties

| Property | Type |
|---|---|
| `name` | `any` |
| `version` | `any` |
| `supportedPatterns` | `any` |

## Where it refuses work

- `LaravelParser` stops the work with an early return when `!source.trim()`.
- `LaravelParser` stops the work with an early return when `!/(\bRoute\s*::|\bSchema\s*::|\bclass\s+\w+|->\s*withRouting)/.test(source)`.
- `LaravelParser` stops the work with an early return when `method === 'group'`.
- `LaravelParser` stops the work with an early return when `!/RouteServiceProvider|withRouting/.test(clean)`.
- `LaravelParser` stops the work with an early return when `!header`.
- `LaravelParser` stops the work with an early return when `!rules`.

## When something fails

- `LaravelParser` handles failure in 1 place: it turns it into a return value in all 1.
