I
I
ImPuuLsE2015-08-28 08:58:00
Laravel
ImPuuLsE, 2015-08-28 08:58:00

How to initialize Blade templates from a base field?

Hello! There is an ordinary view in which a field from the database is displayed, for example - description (in which the usual html code is inserted). I would like to use Blade templates inside this html code. How to implement it?
I found something similar - instead of a view, just a field from the database is displayed in which I write what should have been in the view.

@extends('frontend.layouts.main')
@section('title'){{$page->title}}@endsection
@section('meta_keywords'){{$page->meta_keywords}}@endsection
@section('meta_description'){{$page->meta_description}}@endsection
@section('content')
@widget('lastNews')
@endsection

Everything works, but I would not want to rewrite all these sections every time a new page is created. I just want to leave the usual view so that the Blade templates are read in the description field:
@extends('frontend.layouts.main')
@section('title'){{$page->title}}@endsection
@section('meta_keywords'){{$page->meta_keywords}}@endsection
@section('meta_description'){{$page->meta_description}}@endsection
@section('content'){{$page->description}}}@endsection

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question