如何在Laravel中添加变量
我有一个控制器方法来更新数据库中的记录:
$brand_owner_relation = Relation::where('rel_brand_id',$id)->where('rel_is_active',0)->first();
$brand_owner_relation->rel_status_id = 10;
$brand_owner_relation->save();
return redirect()->back()->with('message',"Brand
{{ $brand_owner_relation->brand_name }}
is now active
");
现在更新数据的过程工作正常,但我需要将刀片中的品牌名称显示为会话。
所以我尝试过:
return redirect()->back()->with('message',"Brand
{{ $brand_owner_relation->brand_name }}
is now active
");
但这是错误的,因为它没有将品牌名称显示为会话值...
因此,如果您知道如何将品牌名称显示为会话值,请告诉我。
I have a Controller method that updates a record in the DB:
$brand_owner_relation = Relation::where('rel_brand_id',$id)->where('rel_is_active',0)->first();
$brand_owner_relation->rel_status_id = 10;
$brand_owner_relation->save();
return redirect()->back()->with('message',"Brand
{{ $brand_owner_relation->brand_name }}
is now active
");
Now the process of updating data is working fine but I need to show the Brand Name in the Blade as session.
So I tried :
return redirect()->back()->with('message',"Brand
{{ $brand_owner_relation->brand_name }}
is now active
");
but this is wrong cause it does not shows the brand name as session value...
So if you know how to show brand name as session value, please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)