guard{$guard}->check()): ?>"; } /** * Compile the else-auth statements into valid PHP. * * @param string|null $guard * @return string */ protected function compileElseAuth($guard = null) { $guard = is_null($guard) ? '()' : $guard; return "guard{$guard}->check()): ?>"; } /** * Compile the end-auth statements into valid PHP. * * @return string */ protected function compileEndAuth() { return ''; } /** * Compile the env statements into valid PHP. * * @param string $environments * @return string */ protected function compileEnv($environments) { return "environment{$environments}): ?>"; } /** * Compile the end-env statements into valid PHP. * * @return string */ protected function compileEndEnv() { return ''; } /** * Compile the production statements into valid PHP. * * @return string */ protected function compileProduction() { return "environment('production')): ?>"; } /** * Compile the end-production statements into valid PHP. * * @return string */ protected function compileEndProduction() { return ''; } /** * Compile the if-guest statements into valid PHP. * * @param string|null $guard * @return string */ protected function compileGuest($guard = null) { $guard = is_null($guard) ? '()' : $guard; return "guard{$guard}->guest()): ?>"; } /** * Compile the else-guest statements into valid PHP. * * @param string|null $guard * @return string */ protected function compileElseGuest($guard = null) { $guard = is_null($guard) ? '()' : $guard; return "guard{$guard}->guest()): ?>"; } /** * Compile the end-guest statements into valid PHP. * * @return string */ protected function compileEndGuest() { return ''; } /** * Compile the has-section statements into valid PHP. * * @param string $expression * @return string */ protected function compileHasSection($expression) { return "yieldContent{$expression}))): ?>"; } /** * Compile the section-missing statements into valid PHP. * * @param string $expression * @return string */ protected function compileSectionMissing($expression) { return "yieldContent{$expression}))): ?>"; } /** * Compile the if statements into valid PHP. * * @param string $expression * @return string */ protected function compileIf($expression) { return ""; } /** * Compile the unless statements into valid PHP. * * @param string $expression * @return string */ protected function compileUnless($expression) { return ""; } /** * Compile the else-if statements into valid PHP. * * @param string $expression * @return string */ protected function compileElseif($expression) { return ""; } /** * Compile the else statements into valid PHP. * * @return string */ protected function compileElse() { return ''; } /** * Compile the end-if statements into valid PHP. * * @return string */ protected function compileEndif() { return ''; } /** * Compile the end-unless statements into valid PHP. * * @return string */ protected function compileEndunless() { return ''; } /** * Compile the if-isset statements into valid PHP. * * @param string $expression * @return string */ protected function compileIsset($expression) { return ""; } /** * Compile the end-isset statements into valid PHP. * * @return string */ protected function compileEndIsset() { return ''; } /** * Compile the switch statements into valid PHP. * * @param string $expression * @return string */ protected function compileSwitch($expression) { $this->firstCaseInSwitch = true; return "firstCaseInSwitch) { $this->firstCaseInSwitch = false; return "case {$expression}: ?>"; } return ""; } /** * Compile the default statements in switch case into valid PHP. * * @return string */ protected function compileDefault() { return ''; } /** * Compile the end switch statements into valid PHP. * * @return string */ protected function compileEndSwitch() { return ''; } /** * Compile a once block into valid PHP. * * @param string|null $id * @return string */ protected function compileOnce($id = null) { $id = $id ? $this->stripParentheses($id) : "'".(string) Str::uuid()."'"; return 'hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); ?>'; } /** * Compile an end-once block into valid PHP. * * @return string */ public function compileEndOnce() { return ''; } /** * Compile a selected block into valid PHP. * * @param string $condition * @return string */ protected function compileSelected($condition) { return ""; } /** * Compile a checked block into valid PHP. * * @param string $condition * @return string */ protected function compileChecked($condition) { return ""; } /** * Compile a disabled block into valid PHP. * * @param string $condition * @return string */ protected function compileDisabled($condition) { return ""; } /** * Compile a required block into valid PHP. * * @param string $condition * @return string */ protected function compileRequired($condition) { return ""; } /** * Compile a readonly block into valid PHP. * * @param string $condition * @return string */ protected function compileReadonly($condition) { return ""; } /** * Compile the push statements into valid PHP. * * @param string $expression * @return string */ protected function compilePushIf($expression) { $parts = explode(',', $this->stripParentheses($expression), 2); return "startPush({$parts[1]}); ?>"; } /** * Compile the end-push statements into valid PHP. * * @return string */ protected function compileEndPushIf() { return 'stopPush(); endif; ?>'; } }