Facebook
From Colorant Marten, 4 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 254
  1. // Kontroler
  2. <?php
  3. namespace App\Http\Controllers;
  4.  
  5. use App\work;
  6.  
  7. class WorksController extends Controller {
  8.  
  9.         public function works()
  10.         {      
  11.                 $data = work::paginate(10);
  12.                 return view('works')->with('works',$data);
  13.         }
  14.  
  15. }
  16. // Widok
  17. @extends('base')
  18.  
  19. @section('title') Prace @endsection
  20.  
  21. @section('content')
  22. {{ $works->render() }}
  23. @foreach ($works as $work)
  24. {{ $work->name }}
  25. @endforeach
  26.  
  27. @endsection
  28.  
  29.  
  30.  
  31.