Support the ongoing development of Laravel.io →
posted 8 years ago
Views Blade
Last updated 2 years 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 8 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 8 years ago.
0

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

0

Sign in to participate in this thread!

Eventy

Your banner here too?

DocArzt docarzt Joined 16 Jul 2015

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.