示例#1
0
 public function Trust($key)
 {
     $trust = Trusts::where('registry', $key)->orderBy('year', 'asc')->get();
     if ($trust->isEmpty()) {
         $trust = Trusts::find($key);
     }
     return response()->json($trust)->header('Access-Control-Allow-Origin', '*');
 }
示例#2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($registry)
 {
     //
     $trusts = Trusts::where('registry', $registry)->orderBy('year', 'asc')->get()->toArray();
     if (empty($trusts)) {
         $trust = Trusts::find($registry)->toArray();
         $trusts = [$trust];
     } else {
         $trust = $trusts[0];
     }
     $definitions = Definitions::all();
     return view('Gregson', ['trusts' => $trusts, 'selected' => $trust, 'definitions' => $definitions]);
 }
示例#3
0
 public function updateTrust(Request $request, $id)
 {
     $trust = Trusts::find($id);
     $trust->update($request->all());
     return redirect('trusts/update/' . $trust->id);
 }