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.ph…
Tag: laravel-5.8
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…
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…
create counter for blog categories in laravel
I´m traying to create one counter for my blog´s categories. This should appear to the right name side of my category . i´m using my model with variable appends, that after i will use in my blade for show my result in one span. But i don´t know very well how i can use count in my Model. I´m doing
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 –…
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 & Clas…
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 po…
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.
Laravel how to check if at least one column value is true or false
How can I check, if at least one of a bunch of checkboxes is checked/true? I’m using Laravel 5.8 My query right now: So far this works, but “only” returns an array with each value. Like this: I need some kind of value that tells me : is-checked: true/false – something like that. How ca…