Problem: I’m trying to query a PeopleType to find all the courses where a person isn’t associated. I have 4 tables People PeopleTypes Courses People_Courses PeopleType_Courses I have the following …
Tag: laravel-5
Replace string in PHP – not working with longer string
I am beginner in php. I have this code: function allergen(string $value): string { $allergens = [‘pszenica’, ‘pszenicy’, ‘żyto’, ‘żyta’, ‘jęczmień’, ‘jęczmieniem’, ‘jęczmienia’, ‘owies’, …
How to authenticate after register in Laravel
In my project I am trying to validate that registration information and authenticate myself when I register. But what is happening is that when you register, you send me to the Login page, this …
User variables of a function, in another function
I have a Laravel app, which the following PHP code: public function handle() { $post_item->category_id = $source->category_id; $…
Eloquent resolve distant relationship
let’s say I’ve this kind of structure. | lines | | products | | orders | |————| |———-| |——–| | id | | id | | id | | product_id | |———-| …
Javascript “for” loop issue when using ajax, the loop has access even when condition is false
Working with laravel, the system we were developing was crashing on this view on the “onready” event. After looking at the code, we found the problem was inside the for loop. $(document).ready(…
Trying to get property of non-object in laravel 5.6
I get data from database: $user = DB::table(‘view_users’)->where([ ‘id’ => $friend->user_id, ‘type’ => $friend->…
Filtering in Laravel using regex
I’m trying to filter products based on query string. My goal is to get products from a collection if it’s given, otherwise get every product. Could someone help me what’s wrong with the following code?…
Why error handling is not working in Laravel
I have set the debug to true on .env file. Added the exceptions correctly but when i am passing invalid or not exist in my database its showing me 404 error but here I put the custom error handling …
I am getting this error. Method IlluminateValidationValidator::validateReqiured does not exist
I am getting this error for validation of form. Method IlluminateValidationValidator::validateReqiured does not exist. <?php namespace AppHttpControllers; use IlluminateHttpRequest; …