Guest User

Untitled

a guest
May 6th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Controllers;
  4.  
  5. use App\Brand;
  6. use App\Goods;
  7.  
  8. use Illuminate\Http\Request;
  9.  
  10. class BrandController extends Controller
  11. {
  12.     public function brandAction($id){
  13.         $brand = Brand::find($id);
  14.         if($brand){
  15.             $goods = Goods::find(['brand_id' => $brand->brand_id]);
  16.  
  17.             return view('goods', ['goods' => $goods]);
  18.         }
  19.     }
  20. }
Add Comment
Please, Sign In to add comment