Search
 
SCRIPT & CODE EXAMPLE
 

PHP

passing data from controller to blade view laravel

<?php
namespace AppHttpControllers;

use IlluminateHttpRequest;
use IlluminateSupportFacadesDB;

   class EventController extends Controller
{

public function index(Request $request)
{
    $id = $request->query('id');
    $event = DB::table('events')->where('id',$id)->get();
    $pics = DB::table('pictures')->where('event_id',$id)->get();

return view('pages.eventPage',compact('event','pics'));

}

}
Comment

passing data from controller to blade view laravel

public function index(Request $request)
{
  ....

  return view('pages.eventPage', compact('id', 'event', 'n'));
}
Comment

passing data from controller to blade view laravel

@for($i = 1; $i < count($pics); $i++)
<li data-target="#carousel-example-generic" data-slide-to="{{ $i }}"></li>
@endfor
Comment

passing data from controller to blade view laravel

 Route::get('eventpage', 'EventController@index')->name('eventpage');
Comment

PREVIOUS NEXT
Code Example
Php :: datatables compactible with bootstrap v4 
Php :: storefront header cart 
Php :: jupiter/framework/admin/generators/option-generator.php on line 80 
Php :: php encrypt decrypt online 
Php :: jobs laravel 
Php :: $this-uri-uri_to_assoc(5); 
Php :: button onclick php 
Php :: 279.00 to php 
Php :: import csv file in laravel 8 
Php :: can we acces session variable in two files 
Php :: laravel dompdf barcode 
Php :: test lockForUpdate laravel 
Php :: getting key from env returns null laravel 
Php :: wp_ajax_nopriv 
Php :: php echo to stderr 
Php :: Return the union of this RDD and another one 
Php :: laravel capitalize first letter 
Php :: how to refresh a php variable without reloading page 
Php :: php version 5.6 
Php :: How to Validate an Email Duplicate Entry in Codeigniter 
Php :: codeigniter get view as string 
Php :: Multi-idiomas com PHP 
Php :: use scope in statamic template 
Php :: show data as per url slug change in laravel 
Php :: evaluate home tilde ~ in php 
Php :: laravel return response with headers 
Php :: X-Frame-Options may only be set via an HTTP header sent along with a document. It may not be set inside <meta. 
Php :: wc php order view order link 
Php :: Laravel-permission update name 
Php :: index.php when deploying 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =