Skip to content
Advertisement

Tag: laravel-5.8

Update() in Laravel does not seem to be working

I’m working with Laravel 5.8 to develop my project and I have this table which shows some data from the DB: As you can see there’s a link named Edit for editing these data, so when someone clicks on that, this method runs: I have also added this form for updating the data sent to the edit.blade.php: And here is

Laravel 5.8: Can you help me with this problem

I’m using Laravel 5.8 to develop my Online Store. And in this store, every product has a field of prd_delivery and it can be set one of these values: city_free_delivery country_free_delivery null When it is null, it means that it does not have any free delivery type. And when users select their products, these situations must be applied: Note that

How to send multiple data into view with their required relationships

I am working on a Laravel 5.8 project which is an Online Store. and in this project, I wanted to add “Printing Order Factors” feature for Admins. So I have made a form like this: So basically admins can select multiple orders like this: And I’m trying to send order ids as an array: <input class=”form-check-input” name=”orderCheck[]” type=”checkbox” value=”{{ $order->ord_id

pagination data with laravel 5.8

I´m traying to paginate my results of query, but i have a problem with this. I have this code in my controller: and in my view: but i have one error when render blade: i did a print_r and this it´s result: so that, i can show my post in my blog page, but when render blade i can´t show

Laravel – How to query Eloquent relationship?

I have this models in Laravel-5.8: Then I have this Query in Employee controller function: How do I include where is_active = 1 from employee_types into the query in Employee: Answer You are looking for the whereHas method, querying for the existence of a relationship: Laravel 5.8 Docs – Eloquent – Relationships – Querying Relationship Existence whereHas

hasManyThrough – Laravel 5.8

I have database table structure like : ClassRoom id (int) PK name (varchar) ClassTeacherCourse id (int) PK id_classroom (int) FK id_teacher (int) FK id_course (int) FK Course id (int) PK course_name (varchar) Teacher id (int) PK teacher_name (varchar) So far I have code just to call ClassRoom table & ClassTeacherCourse, like : Relationship in Class Model : Result : I

get a deeper element which satisfies the condition

Need to get the postal_code value, which is the value of long_name with types=postal_code. In the api result,it seems types itself is an array. Looping and finding out is a bad method. also array_search also don’t work. Can anybody help me. Answer Just loop through the array and find an item with the postal code: I’ll leave error handling to

Laravel how to create a seeder based on array

How can I create a laravel-seeder based on an array? I have an array like this: So instead of doing like this for each entry, I was hoping there might be another way to achieve that? Answer Option A) Option B) Note: Insert doesn’t automatically populate the timestamp columns.

Advertisement