Skip to content
Advertisement

Tag: laravel

How to combine two counts using Laravel

Using Laravel 8 for a restful API. A table in the database has following fields report_date , supervisor_id and supervisor_note I want to retrieve a result that counts the number of reports on any given day date and also counts all of the null values in supervisor_notes field. I am using the following Laravel code: I don’t know how to

Laravel Fix No ‘Access-Control-Allow-Origin’ header is present on the requested resource

How to solve No ‘Access-Control-Allow-Origin’ header is present on the requested resource. On Laravel 7 what can I do to the response? I have tried this, but it doens’t include the header. Edit 1 I already have FruitCakes Cors added (https://github.com/fruitcake/laravel-cors) My xhr request is coming from my mobile website which is hosted on a subdomain. mobile app hosted at

Identify Laravel Package using File Structure

Description: I’ve task to integrate some PHP MVC project in my Laravel Project whereas I’m Laravel Developer in which I’m getting error Not Defined Error. Therefore, I’m trying to understand this project. Hence, I’ve made this question to identify the framework. Below is my File Structure of Some Project Below is my Controller return view using blade template with ::

how to convert $request format in laravel

I search around for a bit but found nothing that did exactly what I’m after nor anything that really aided me in achieving what I’d like I have data in this format: I’d like to convert it all to this format: i tried: but get no success Answer You got it the other way around. You need to loop on

How to use UUID instead of a slug for ticket

I am currently navigating to a ticket using the slug set by the title example blah-blah-blah and want to use uuid instead of 336c64de-5dcb-34bc-9511-a48242b9zzzb. What is the best approach to take for Laravel 8? I am using Laravel Jetstream with Livewire stack. Current model code Ticket Migration Answer add uuid in migration if you want to use uuid for foreign

How to serve two laravel apps on 1 domain?

I have two laravel apps like this: I’m trying to serve them on linux machine, I can’t seem to get them to work together. I want to have two urls like this: https://test.example.co https://test.example.co/dashboard Answer I succeeded serving them using another subdomain, the “/dashboard” idea didn’t work. I hope someone can suggest the correct way to do it, I would

Advertisement