Skip to content

Data output from the database

I have a select and I want to output data from the DB In CreateController I wrote this I have a UserGuild database And I have such a mistake I need to output to select what is in the User Guide database, but at the same time where {{$guild->name}}and value were were values from the Guild database I also tr…

Get data from a form using post

I have three dropdowns and I can’t get data from two of them using POST, here is my code: I can get the categoryID but not from the supplier or order status Answer All three select has same name attribute please change the values name=”category_id”

php extended class in namespace refactor

I have made a class inside a namespace which is working perfectly fine but I think the code can be better. Right now I have to use a ‘/’ for every object inside the class which is not the best thing to do I assume. } Is it possible to do something like this? So I dont have to use

Laravel : Combine two tables using Model relations

i have two tables :: shops and attachments . Shops has all the details for shop and attachments with all the pictures for shop with ref_id as FK . now for mobile app i have to list shops with Shop title and one image. I can achieve it using leftjoin as below. This returns just shop name and pictures ,

query inside with eloquent

image address has location and total number of users. this query will return all the users and on relation whose query did not match will be null .I want to pull only those users which do not null value on relation and order By accordingly. Answer You can use whereHas condition

Laravel API controller return object along with other arguments

In API controller index function $response holds id’s of media items from db table And if $is_published_pack == ‘false’ I’m successfully returning How to append $response inside when $is_published_pack true condition is met? $response value is I’ve tried for example doing this bu…