Support the ongoing development of Laravel.io →
Views Blade
Last updated 3 months ago.
0

Sorry im ok mobile cant test,

But how are you trying to render it??

$contents = \View::make('youview');

Using this way, to use the facade.

Or at top of your command class

Use View;

And then u can remove the backslash

0

I think before code should try but also you can on your command

$viewHandler = \App::make('Illuminate\View\Factory'); Cant say by reminding, would have to be in computer

$rendered = $viewHandler->make('yourview');

Sorry again on mobile, but what u want is axhievable, i think i put you in the right track

Last updated 6 years ago.
0

yep, tested!!

//console command
$this->info('Hello console!');

        $viewHandler = \App::make('Illuminate\View\Factory');

        $data = ['test' => '123'];

        $rendered = $viewHandler->make('test',$data);

        $this->info($rendered);

        die();

//test.blade.php

Hello Blade!

{!! $test !!}

Please give feedback, marks as solution maybe?? :D

Last updated 6 years ago.
0

Works like a charm! Sorry so late marking it as solution!

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

DocArzt DocArzt docarzt Joined 16 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.