I’ve got a Laravel project on a server, and a Laravel Lumen 8 project on another server, they’re both virtual machines and are clones of one another so have the same hardware and OS. I have a domain, which for the purposes of this Stackoverflow we’ll call foo.com, it goes through Cloudflare, both servers are ipv6 servers and when pinging
Tag: lumen
Return custom array in json model with Lumen
With Lumen 8 I have : Model : Store Controller : StoreController Repository : StoreRepository I can get my Store without any problem and get the json below : I would like to get open/close time of the Store. In my model I have a array (for test) and I can show it like that : And get this result
Laravel Lumen Collection – Group By With Sum and preserve the values
I’m working on Lumen and my collection has duplicate values, example: I would like to sum the value property when the name is the same but preserve other values like (department and phone) and remove duplicates entity, example: What’s the best way to do this? Answer This can be achieved using collection functions (https://laravel.com/docs/8.x/collections). In this example I solved it
Lumen: The new record with default values was added to database
I’m new to PHP and I’ve tried to make the small test full-stack project. I have Vue.js app on the client (frontend) and PHP (Lumen) on the server (backend). The code looks as following: Client: Vue component: Server: Router: Model: Controller: Database: Debug session on server side – $request value: The issue is the new record was added to database,
Lumen : using helper get error : Using $this when not in object context
I have create this helper in Helpers folder inside Http folder: when I call it in controller : it give me this error : Using $this when not in object context where I remove $this in function I get this error : Call to undefined function AppHttpHelperscheck_id() Answer check_id is a static function if you want to access it into
how to pass parameters to listener in laravel?
I registered LogConnectionFailed like this: The ConnectionFailed event is fired if no response is received for a given request. I need to The name of the class and the method in which this happened and duration time call http client in LogConnectionFailed class. Answer This is not possible through normal parameter passing, so I utilized PHP native function debug_backtrace() and
Laravel Lumen Logging gives A facade root has not been set
I have set up the basic example of Laravel lumen with composer create-project –prefer-dist laravel/lumen demo. I am using Lumen version 8. My .env file looks like I have created a controller TrackerController and called it in routes/web.php. My /app/routes/web.php looks like I would like to add logging to stdout (so I can later pipe that data to Cloudwatch in
Custom service provider for Lumen
I’m new to Lumen, and have a fresh install (v8.2.4) and have followed the docs, trying to write my own service, but I keep getting error Like I said, its a fresh install according to the Lumen docs. in /bootstrap/app.php in /app/Providers/BatmanServiceProvider.php My controller: app/Http/Controllers/MainController.php What am I missing/doing wrong? Answer in /bootstrap/app.php in /app/Providers/BatmanServiceProvider.php create Services folder in your_lumen_project/app,
PHP Swoole Notice ERRNO 1005
When Swoole is on heavy load and heavy requests I kept getting this Log: [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists [2021-01-24 16:07:39
Laravel with() and search using LIKE not working
So I have 2 tables, 1 table for storing debt(id, amount, category_id) and 1 table for storing debt categories(id, name). I am trying to pull the data for each month from the debt table, but I also have a search which seems to not work, I guess I am missing something. I have the following: Debt Model: This works fine,