dimanche 23 juillet 2017

Retrieving from DB in laravel

I'm trying to retrieve a column from a localhost db using laravel framework and i get this error: ErrorException in cd582248476d4ab73365f604ce058f390fc48144.php line 10: Undefined variable: Delivery (View: C:\xampp\htdocs\testt\resources\views\Delivered.blade.php)

  @extends('layouts.master')

@section('title')
    Pharmacies
@endsection

@section('content')

<section class="row posts">
        <div class="col-md-6 col-md-offset-3">
            <header><h3>Details of Delivered Orders</h3></header>
            @foreach ($Delivery as $Delivery) {
              echo $Delivery->Address;
          }
          @endforeach
}
        </div>
    </section>
@endsection



<?php
namespace App\Http\Controllers;

use App\User;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Collection;

class DeliveredController extends Controller
{
    public function getDeliveredPage()
    {
      return view('Delivered');
    }
    public function index()
   {
       $Delivery = Delivery::all()->get();

       return view('Delivered' ,['Delivery'=>$Delivery]);
   }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire