Shortcodes in your Laravel App
HTML-код
- Опубликовано: 30 сен 2024
- devdojo.com/ninja - Learn how to create your own Software as a Service in my Ninja Training Program.
In this short video we'll show you how to inject code into your views using Middleware. You can create a shortcode in your view files and replace it with anything you would like using Middleware.
This will come in handy if you release a product and don't want to dynamically change content in your views from a shortcode.
Why do not you use Blade with custom directives? You can simply extend them it.
The proposed implementation is similar to a crutch.
im implemented this but getting this
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined function App\Http\Middleware\str_repace()
laravel 5.7
By calling $next() before return, aren't you working with the result of your NEXT middleware in THIS middleware?
+Владислав Новик By checking that the response has the 'content' method it should move down the chain until it reaches the content, and it will modify it after all other middleware has been run :) Let me know if that helps.
thanks.
Hello, what sublime theme do you use? If it;s custom, would you mind sharing it?
+Kyle Sheldon It's called the Material theme :) You can get it for free here: github.com/equinusocio/material-theme
what terminal do you use?
anymore videos coming? want mooar geek content- feed me :)
+Sam Deacon Haha, thanks. I was planning on doing another video this weekend. Appreciate the comment. I'm definitely ramping up the videos to at least a couple a week starting next year :D