Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 466 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass session variable in laravel using api

#1
Find below the blade file:

@foreach($product1['domains']['domain'] as $product)
<tr role="row">
<td class="sorting_desc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Rendering engine: activate to sort column ascending" aria-sort="descending">1</td>
<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"aria-label="Browser: activate to sort column ascending">
<a href="" style="color:#23b7e5" data-toggle="modal" data-target="#myModal1">
{{$product['domainname']}}
</a>
</td>
<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">
{{$product['regdate']}}
</td>
<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">

{{$product['expirydate']}}
</td>


<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">Renew</td>

</tr>
@endforeach

Find below the route code:

Route::get('/mydomains','InvoiceTicketController@set');

The controller code is given below :


class InvoiceTicketController extends Controller
{

public function set(){
$product1=Whmcs::GetClientsDomains([]);
return view('clientlayout.main.mydomains',compact('product1'));
}
}

Suggest me a solution to pass session variable in laravel to display the domains based on the client in my view file.

Reply

#2
Just use the helper function session().

On the controller you can use like this:

$value = $request->session()->get('key');

To store the data on the session you can do like this:

$request->session()->put('key', 'value');

On the views you can use the function session to retrieve the value:

{{ session(['key' => 'value']) }}
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through