laravel - Store SMS template in database and render it later -


i need store sms template in database. hello, {{ $username }}.

apparently it'd solution use blade templates here. how can retrieve sms template database , compile variables? same way views when rendering blade templates instead render database?

one simple way create temp view file everytime want send sms template

$templatefromdatabase = 'hi, {{$username}}';  $tempfilepath = time().'.blade.php'; file::put($tempfilepath, $templatefromdatabase);  //render view $html = view::make($tempfilepath,['username'=>'my name']); 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -