Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Controllers\Hosts;
- use App\Http\Requests\Host;
- use App\Models\Hosts;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- class HostsController extends Controller
- {
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function index()
- {
- $hosts = Hosts::all();
- return view ('hosts.manage', compact('hosts'));
- }
- /**
- * Show the form for creating a new resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function create()
- {
- return view ('hosts.create');
- }
- /**
- * Store a newly created resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Illuminate\Http\Response
- */
- public function store(Host $request)
- {
- // Hosts::create(
- // request(['name', 'description', 'address', 'city','state', 'phone', 'mobile_phone', 'email', 'website'])
- //// request()->file('photo')->store('photos')
- // );
- var_dump($host = Hosts::create($request->all()));
- return Response::json($host);
- // return redirect('host');
- }
- /**
- * Display the specified resource.
- *
- * @param \App\Models\Hosts $hosts
- * @return \Illuminate\Http\Response
- */
- public function show(Hosts $hosts)
- {
- //
- }
- /**
- * Show the form for editing the specified resource.
- *
- * @param \App\Models\Hosts $hosts
- * @return \Illuminate\Http\Response
- */
- public function edit(Hosts $hosts)
- {
- //
- }
- /**
- * Update the specified resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @param \App\Models\Hosts $hosts
- * @return \Illuminate\Http\Response
- */
- public function update(Request $request, Hosts $hosts)
- {
- //
- }
- /**
- * Remove the specified resource from storage.
- *
- * @param \App\Models\Hosts $hosts
- * @return \Illuminate\Http\Response
- */
- public function destroy(Hosts $hosts)
- {
- //
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement