Category : request

I’m trying to create user authentication for Active Directory. I am using Laravel and standard authentication. I slightly altered the standard login form, earlier there were input fields email and password. In form I changed these two fields: <input type="text" name="accountName" required> (Active Directory account) <input type="password" name="activeDirectoryPassword" required> (Active Directory password) In these fields, ..

Read more

I got SoapFault Could not connect to host where is the my problem? I think soapheader it is working problemly or I do not know why please help me. ///this is controller $this->soapWrapper->add(‘Search’, function ($service) { $headerbody = array( ‘Content-Type’ => ‘application/soap+xml’, ‘charset’ => ‘utf-8′, ); $ns =’http://test-api.xml.agency/SiteCity?singlewsdl’; //here is a my request $myheader = ..

Read more

I have the following input { "password":"password", "environment_roles":[ { "environment_id":"", "role_id":"" } ], "admin":true } and have a Request class with following rules : public function rules() { return [ ‘password’ => ‘required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*d).+$/’, ‘environment_roles’ => ‘array’, ‘environment_roles.*.role_id’ => ‘required_if:admin,false|exists:roles,role_id’, ‘environment_roles.*.environment_id’ => ‘required_if:admin,false|exists:environment,environment_id’, ‘admin’ => ‘sometimes’ ]; } But it is showing the following validation error ..

Read more

I need a bit of help here. When I print $request and $request->fullUrl(), it prints as follows POST /web/abcd/example?id=1&[email protected] HTTP/1.1 Accept: application/json, text/plain, */* Accept-Encoding: gzip, deflate . . . and http://0.0.0.0:8080/web/abcd/example?email=%20%20a%40a.com&id=2 But when I try to read query parameter by $request->get(’email’) it returns [email protected] instead of [email protected] How can I get the correct email? ..

Read more

Each user has a role. When creating a new user form the admin panel, I am not able to create a user with any role id other than 2 i.e. customer. This is my controller function: public function store(UsersRequest $request) { // if(trim($request->password) == ”){ $input = $request->except(‘password’); } else{ $input = $request->all(); $input[‘password’] = ..

Read more

this is how i do the ajax that send data by making an array call mdata var mdata={}; mdata[‘evid’]="4"; console.log(mdata); $.ajax({ type: "POST", headers: { ‘X-CSRF-TOKEN’: $(‘meta[name="csrf-token"]’).attr(‘content’) }, url: "/DeleteKegiatan", processData: false, contentType: false, data: mdata, success: function(e) { } }); Controller public function destroy(Request $req){ print_r($req->input(‘evid’)); print_r($req[‘evid’]);print_r("aa"); //it only return "aa" die(); } thanks ..

Read more

I am trying to retrieve some part of request() in my Form Request class named StoreApplicantLanguage.php. The request key called ‘languages’ and it has an array of objects containing a key-value pair to be stored in my `applicant_languages’ table. Here is my JSON request from Postman: { "languages": [ { "language": "English", "capability": 1, } ..

Read more

here is my function. public function get(Request $request){ $bike1 = $request->input(‘bike1’); $bike2 = $request->input(‘bike2’); //dd($bike1); return $bike2->name; } When i use the dd function, the result is: "{"id":1,"created_at":"2020-09-16T12:33:25.000000Z","updated_at":"2020-09-16T12:33:25.000000Z","name":"302r","brand":"benelli","price":800000,"displacement":300,"segment":"300cc","power":"[email protected] rpm","torque":"[email protected]","fuel_delivery_system":"Efi","abs":"1","cooling_system":"Liquid","weight":155} ◀" But when I try to access the name property(any) i get the error. Trying to get property ‘name’ of non-object What I might be missing? ..

Read more

I have an application I’m working on and there’s a post request in Laravel that I’m trying to emulate in Postman, but it’s just not working. $response = Http::post(‘http://third-party-api.com/login’, [ ‘username’ => ‘username’, ‘password’ => ‘password’, ]); When I try what I believe to be the same request in Postman, it just tells me the ..

Read more

I’ve extended the IlluminateHttpRequest class and am passing it along to my controller. use IlluminateHttpRequest; class MyRequest extends Request { … } Controller class MyController { // Doesnt work public function something(MyRequest $request) { var_dump($request->session()) } // Does work public function something(IlluminateHttpRequest $request) { var_dump($request->session()) } } So when I’m trying to get session $request->session() ..

Read more

I’am sending parameters from one to another without pasing through route pass them another way for security, but problem last function loses parameter and even dd doesn’t work it returns view only with udefined variable $data. Here is my code in controller: public function show_auth($id) //pass id to test.auth { return view(‘test.auth’,compact(‘id’)); } public function ..

Read more