I have a controller
public function store(Request $request)
{if ($request->input('asc')){
$image = PropertyUser::where('user_id', '=', Auth::user()->id)->get();
foreach($image as $property)
{
$id = $property->property_id;
}
$image_ = Image::where('property_id', $id)->sortBy('description')->get();
return redirect('settings/photos');
How can i redirect with the $image_
variable and display it in my view file
@foreach ($image_ as $images)
<div class="image-warp"><img src="{{$images->filename}}"
style="width:100px;height:100px;"><br/><span style="color: #1b1e21">{{$images->description}}</span>
</div>
@endforeach
You can use the compact function to pass it to your view and reference it by the name.
return redirect('folder.name', compact('variableName');
return redirect()->route('folder.name', [$image]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With