Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Controllers\Hosts;
  4.  
  5. use App\Http\Requests\Host;
  6. use App\Models\Hosts;
  7. use Illuminate\Http\Request;
  8. use App\Http\Controllers\Controller;
  9.  
  10. class HostsController extends Controller
  11. {
  12. /**
  13. * Display a listing of the resource.
  14. *
  15. * @return \Illuminate\Http\Response
  16. */
  17. public function index()
  18. {
  19. $hosts = Hosts::all();
  20. return view ('hosts.manage', compact('hosts'));
  21. }
  22.  
  23. /**
  24. * Show the form for creating a new resource.
  25. *
  26. * @return \Illuminate\Http\Response
  27. */
  28. public function create()
  29. {
  30. return view ('hosts.create');
  31. }
  32.  
  33. /**
  34. * Store a newly created resource in storage.
  35. *
  36. * @param \Illuminate\Http\Request $request
  37. * @return \Illuminate\Http\Response
  38. */
  39. public function store(Host $request)
  40. {
  41. // Hosts::create(
  42. // request(['name', 'description', 'address', 'city','state', 'phone', 'mobile_phone', 'email', 'website'])
  43. //// request()->file('photo')->store('photos')
  44. // );
  45.  
  46. var_dump($host = Hosts::create($request->all()));
  47.  
  48. return Response::json($host);
  49.  
  50. // return redirect('host');
  51. }
  52.  
  53. /**
  54. * Display the specified resource.
  55. *
  56. * @param \App\Models\Hosts $hosts
  57. * @return \Illuminate\Http\Response
  58. */
  59. public function show(Hosts $hosts)
  60. {
  61. //
  62. }
  63.  
  64. /**
  65. * Show the form for editing the specified resource.
  66. *
  67. * @param \App\Models\Hosts $hosts
  68. * @return \Illuminate\Http\Response
  69. */
  70. public function edit(Hosts $hosts)
  71. {
  72. //
  73. }
  74.  
  75. /**
  76. * Update the specified resource in storage.
  77. *
  78. * @param \Illuminate\Http\Request $request
  79. * @param \App\Models\Hosts $hosts
  80. * @return \Illuminate\Http\Response
  81. */
  82. public function update(Request $request, Hosts $hosts)
  83. {
  84. //
  85. }
  86.  
  87. /**
  88. * Remove the specified resource from storage.
  89. *
  90. * @param \App\Models\Hosts $hosts
  91. * @return \Illuminate\Http\Response
  92. */
  93. public function destroy(Hosts $hosts)
  94. {
  95. //
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement