request

HTTP request method is made up of four components:
Request Method ==> Get, Post, Put, Delete (these are
the common ones)
Request URL ==> the URL of the resource
Request Header ==> Accept-Language, AcceptEncoding, User-Agent, Host
Request Body ==> This is the data to be sent to the
resource
Request Query Parameters : key value pair 
		 	
HTTP response method is made up of three components:
Response Status Code ==> 200, 301, 404, 500
(these are the most common ones)
Response Header Fields ==> Date, Server, LastModified, Content-Type
Response Body ==> This is the data that comes
back to the client from the server.

4
4
Awgiedawgie 440215 points

                                    <?php

namespace App\Http\Controllers\Auth;

use App\Models\User;
use App\Models\Admin;
use App\Models\Blogger;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Http\Request;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;
    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
        $this->middleware('guest:admin');
        $this->middleware('guest:blogger');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'password' => 'required|string|min:6|confirmed',
        ]);
    }

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function showAdminRegisterForm()
    {
        return view('auth.register', ['url' => 'admin']);
    }

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function showBloggerRegisterForm()
    {
        return view('auth.register', ['url' => 'blogger']);
    }

    /**
     * @param array $data
     *
     * @return mixed
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);
    }

    /**
     * @param Request $request
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    protected function createAdmin(Request $request)
    {
        $this->validator($request->all())->validate();
        Admin::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => Hash::make($request->password),
        ]);
        return redirect()->intended('login/admin');
    }

    /**
     * @param Request $request
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    protected function createBlogger(Request $request)
    {
        $this->validator($request->all())->validate();
        Blogger::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => Hash::make($request->password),
        ]);
        return redirect()->intended('login/blogger');
    }
}

4 (4 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
What is HTTP Request/Response standard http request HTTP Request a Response http request calls example http request request use http http request ned http requesten http requester http request meaning http request s response request response http request how does an http request work http request https HTTP request/response request with http http request options HTTP REQUESTE RESPONSE what is http requestor what si http request http web request http request and what is http request? request methods http http request method http request and response what is in a http request http we request http .request http.request example what is in an http request http.request( what is http request and response status request What is HTTP? What are HTTP request and response? http.request https? status http.request() http.request({ use request http http request % options http request in http request http request with ? What is an HTTP request? http response request request request http.request https.request request http request response what is an http request verb html request is https a http method what kind of request is a .get looking for https method htp methods To send some information to the server to add to or modify the web page the _________ method is used in HTTP methods http request response http xhttp request http requests and response what is http request is use an http request verb HTTP Request definition http request syntax what is http verbs server methods type accept http request methods HTTP method/verb method part of http request http get format HTTP Get commands specify HTTP Method required in fetch http create http request Define HTTP Methods asign http methods get post put delete request line in http method="request" http request && this.execute ({action:Request Method Type.Retreve this.execute ({action:Request Method Type wher to see method of api call http list of http requests is put a valid http header is post a valid http header http request methods header website request commands get put request. distribution of http methods http requestr httpn request http request types get http request what are http methods http request methods in 2019 HTTP supports different access methods. As of 2019, 5 methods are supported: HEAD, GET, POST, PUT and DELETE. default request http http data request request method of items in database get http 1.1 request verbs get and post methods are Select one: A. response methods B. none of them C. request methods D. request and response methods What are HTTP verbs? Give at least 2 examples of how they are used. http methods js generate request-line for request http types request what does http request get do http request mdn what is a get request types of http requests POST /contact HTTP/1.1 what is a http request HTTP request mode perform loop back along the target resource request type format an http 1.1 request all methods html Name all the HTTP methods/verbs http calls what are http verbs request http command make request http https request how to get data from a http get request js http request http methods -F How do you find out the HTTP method of a request? what is http request method a standard http request contain http request response http "verbs" server request http request http method html request httpget is sending http request request http\ http.get http get example url request method what http method should i use for sending message http verbs what are http requests http get post headers request line of html http get request example http get request get http request with request is # supported in get request http request in web HTTP request method website request types http methods all http request methods web methods get post delete Define the variations between the various HTTP methods and when each method should be used and define the parts of a URL What is the appropriate form for an HTTP request http request format get request http http protocol get query http methods explained What does an HTTP request contain? http request example header method in http HTTP HEADER to tell URI of resource obtained http types http verb requests submission and responses processing http http call The HTTP request method Get request get request syntax You use this HTTP Request method, ________, to retrieve data from an API. You use this HTTP Request method, ________, to retrieve data from an API request.method http requests request methods http request methods https response methods http request
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source