Professional Documents
Culture Documents
Serach All:: All '/allpizza' 'App/Http/Controllers/Pizzacontroller@All'
Serach All:: All '/allpizza' 'App/Http/Controllers/Pizzacontroller@All'
a) Web: all
Route::get('/allpizza', 'App\http\controllers\PizzaController@all');
b) PizzaController: all
public function all(){
// $arrPizza = Pizza::all();
//echo "<pre>"; print_r ($arrPizza);
$rec = Pizza::OrderBy('name','desc')->get();
//$arrPizza = Pizza::where('name','wissam')->get();
return view ('display', ['record'=>$rec]);
}
c) View: 'display'
<?php
//echo "<pre>"; print_r ($record);
?>
@extends('HeaderFooter')
@section('content')
<!-- @foreach($record as $rec)
{{$rec->type}} <?php /* echo "<br>"; */ ?>
{{$rec->base}} <?php /* echo "<br>"; */ ?>
{{$rec->name}} <?php /* echo "<br>"; */ ?>
@endforeach -->
@foreach($record as $rec)
{{$rec->type}} --
{{$rec->base}} --
{{$rec->name}} --
<?php echo "<br>"; ?>
@endforeach
@endsection
**************