Combining Laravel with Pug (Jade)? - laravel

Is it possible to easily combine Laravel Blade layouts with Pug (formerly known as Jade)?

Yes it is. You can use laravel-elixir-jade npm package. The only problem I occurred was including mixins from external file. Everything else works perfectly.

You may try with laravel-pug.

If you want to work with pug (jade) in the same way like with blade and want to use blade in the same time then use should use https://github.com/BKWLD/laravel-pug

Related

How to Use Vuejs on Laravel blade

everyone, I want to make a dormitory management system with laravel and vuejs but I don't know how to display my data instead of "welcome.blade.php" file but instead of "blade" use vue component if someone knows this please help me how to do this. I use API route for this
thanks everyone
You don't use it instead of blade you mostly use it with or inside blade.
Use Vue like normally would just treat your blade template as your plain HTML.

Live Edit in PhpStorm for Laravel projects

I like to use Live Edit feature, however, it seems to me it only works with regular .html files, however, none of the known to me ways work with Laravel .blade.php files. Google didn't answer.
Is there really no way to do so?
For Laravel projects, you can use BrowserSync to automatically refresh websites when you make changes to your template files. Support for BrowserSync comes out of the box with Laravel Mix. To use this feature, all you have to do is go to your webpack.mix.js file and add the mix.browserSync() function call. If you're using Laravel Valet or something similar to get pretty URLs, you can pass in a URL as an argument to proxy.
mix.browserSync();
// OR
mix.browserSync('my-domain.test');
Documentation: Compiling Assets (Mix)

Can Laravel Blade be used in a sandbox environment?

Can Laravel Blade be used in a sandbox environment, similar to Twig's sandbox extension?
I have the need to allow users to use a template system but obviously do not want them executing arbitrary PHP code on the server.
I would like to use Blade since it's already part of Laravel but suspect this isn't possible.
The short answer is no, by default.
You could probably implement this yourself however, by extend blade to add custom functionality. See the Blade Documentation.

How can I access images into plugin in cakephp 2.*?

I saved my plugin images in here:
app/plugin/my-plugin-name/webroot/img/...
now :
I want to access theme same as $this->Html->image(path)
what is your plan for this?
thx
You can use:
$this->Html->image('My-Plugin-Name.image.png');
See also http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::image
When I need to include a CSS from a folder outside CSS, I use this, it may work in your case
$this->Html->image(array('../../plugin/my-plugin-name/webroot/img/imagename');
Anyway, you can also use absolute routes
$this->Html->image(APP . 'plugin/my-plugin-name/webroot/img/imagename');

How to add page specific JavaScript files to the Laravel Assets Pipeline?

I using Laravel Assets Pipeline(https://github.com/CodeSleeve/asset-pipeline) plugin for the my project.
I was able to successfully configure with the common JS files (jquery.js, global.js) included in the page. I have some page specific JavaScript files that needs to be included.
home.js
about-us.js
I tried with following but I think it's not the correct way to achieve this.
{{ HTML::script('assets/home.js'); }}
According to the asset-pipeline documentation it should be used like that :
<?= stylesheet_link_tag() ?>
<?= javascript_include_tag() ?>
There is a manifestFile argument which can maybe load only some specific files.
Are you sure it is compatible with HTML facade ? If it is, there is maybe a route to configure :/
And as far as I understand the documentation, you shouldn't call your script like that, one of the aim of your asset pipeline is to delegate it, isn't it ?

Resources