Answers for "http request laravel"

PHP
2

laravel http request get response

use Illuminate\Support\Facades\Http;

$response = Http::get('http://example.com');

// The get method returns an instance of Illuminate\Http\Client\Response,
// which provides a variety of methods that may be used to inspect the response:
$response->body() : string;
$response->json() : array|mixed;
$response->collect() : Illuminate\Support\Collection;
$response->status() : int;
$response->ok() : bool;
$response->successful() : bool;
$response->failed() : bool;
$response->serverError() : bool;
$response->clientError() : bool;
$response->header($header) : string;
$response->headers() : array;
Posted by: Guest on February-26-2021
1

laravel request

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class UserController extends Controller
{
    /**
     * Store a new user.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $name = $request->input('name');

        //
    }
}
Posted by: Guest on July-20-2021
1

laravel 6 make http request

$client = new GuzzleHttp\Client();
$res = $client->get('https://api.github.com/user', ['auth' =>  ['user', 'pass']]);
echo $res->getStatusCode(); // 200
echo $res->getBody(); // { "type": "User", ....
Posted by: Guest on September-10-2020
0

laravel get all request parameters

$request->input('name');
$request->input('user.name'); // fetch from user object
Posted by: Guest on November-13-2020
0

how to see with page reuested in laravel

$request->fullUrl()
Posted by: Guest on November-07-2020
0

get request laravel

$user->date = date('Y-m-d');
	$user->completed_status = '0';

	$user->name=  $request->Input(['name']);



	protected function create(array $data)
{
    return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => bcrypt($data['password']),
    ]);
}


DB::table('users')->insert([
        'Email' => '[email protected]',
        'Name' => 'Administrator',
        'PhoneNumber' => '00000',
        'Password' => bcrypt('P@ssw0rd'),
        'isEnabled' => true,
        'isAdmin' => true
        ]);

Admin::create(['name' => 'Super Admin', 'email' => '[email protected]', 'password' => bcrypt('password') ]);
Posted by: Guest on October-12-2021

Browse Popular Code Answers by Language