Skip to content
Advertisement

Tag: laravel

Why is only the last element of an array being output in Laravel?

I have a select where a value needs to be selected. Select is formed using a foreach loop. I get the values ​​correct and correct, but when I try to put this value into the session, only the last value of the cycle gets into it all the time. Why is that? Answer In your loop you overwrite the key

Laravel & vuejs cpanel share hosting app migration problem

I’m sorry for my English. Good day, developers, I need your help, I have an app that I must migrate https://creamedicinaprepagada.com/ It is developed in Laravel + VueJS, at the moment it is hosted in AWS CPANEL, but I must migrate to CPANEL HOSTINGER. I am passing all the files and databases from the AWS CPANEL to CPANEL HOSTINGER, the

Get API over VPN with PHP [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I have a question with my problem. I have a task where I want to get the REST API but the API is through a VPN.

Filtering Laravel datetime field for values after a certain time

I have an eloquent model that has a “start_time” field, which is of type dateTime, and I want users to be able to filter instances of the model based on time of day. So for example, the “start_time” field is in the format “2021-02-17 21:52:12” and I want the user to be able to send “08:00:00”, and then filter all

Ways to write Laravel routes

Is there a better way to write these routes? It seems I am repeating the same controller in my route files. Answer You can use a resource route, where you specify a subset of actions in the controller. You can also use the –model option when generating a controller with the stubbed out CRUD methods. Result:

Error in showing laravel data to blade using eloquent

I have this Contractor Model And ContractorDetails Model I can retrieve all columns under the Contractors Model, but whenever I do this $contractors->ContractorDetails->id, it will show this error “Trying to get property ‘id’ of non-object” . however when I just use this $contractors->ContractorDetails, it is able to show this collection {“id”:6,”contractors_id”:24} My controller looks like this My blade file Any

Advertisement