I have a Laravel project as the subfolder of another project. The main project is developed in core PHP. Now I want to access a class in the main project inside my Laravel project. I know if it is inside the Laravel project I can use autoload in composer.json. But here it is outside the ..
Category : lumen
Is there any way through which the rate limit duration can be customized. For instance, I am using the default laravel rate limiter. I would want to have something like – allow 10 requests per hour Any help would be appreciated. Sourc..
Is there any way through which the rate limit duration can be customized? For instance, I am using the default Laravel rate limiter. I would want to have something like – allow 10 requests per hour. Sourc..
i want to use delay and onQueue methods at same time but i’ll get error: dispatch(new MyJob())->delay(Carbon::now()->addHours(2))->onQueue(‘high’); Error : Call to undefined method LaravelLumenBusPendingDispatch::delay() But in normal laravel app i can do this. Sourc..
I need to see to all queries that executed in api. I tried 3 ways but none of them work 1: IlluminateSupportFacadesDB::listen(function ($query) { Log::info($query->sql, [‘Bindings’ => $query->bindings, ‘Time’ => $query->time]); }); listen method is not existed. 2: Event::listen(‘IlluminateDatabaseEventsQueryExecuted’, function ($query) { Log::debug($query->sql . ‘ – ‘ . serialize($query->bindings)); }); this one didn’t work too. ..
I am learning about microservers, splitting an application back-end onto multiple servers and then having a single frontend server. What I am confused about is how I would tie them all together and ensuring users are authenticated before allowing actions on certain services. For instance, if A: auth.mydomain.com manages all of the authentication (with its ..
I am running a same next.js app on 2 domains and have restful api on lumen (PHP) Want to show different data depend on hostname Eg: if user visit example.com then show USD price from my api and if user visit example.in then show INR price How can i do that in next.js Sourc..
I’m developing a package for Laravel & Lumen in the same code base, but I encountered some problems. Well, in the beginning, I thought it could have the same code and work for both frameworks, however it had! But on the way of development it turned out; it didn’t work and I had to separate ..
I’ve enabled CORS in my nginx and it seems to work OK until I add this peace of code (bolded): public function store(Request $request){ **$validated = $request->validate([ ‘title’ => ‘required|unique:posts|max:255’, ‘file’ => ‘mimes:application/zip,application/x-rar-compressed,application/x-7z-compressed’,** As soon as I add $request->validate() I always get CORS error: Access to XMLHttpRequest at ‘aaa.com/upload’ from origin ‘bbb.com’ has been blocked ..
I want to create a post API where I input an integer (0-100000) it will generate a random string of alphanumerical where the length would be the amount of the input integer. I use Lumen and I’m still new with PHP. I tried to search example function regarding this question but most of them use ..
I have created a view for lumen with this code: <form action="{{ route(‘extentions.update’, [‘id’=>$extention->id]) }}" class="form" method="POST"> @method(‘PUT’) @include(‘extentions._partials.form’) <button type="submit">Enviar</button> </form> However i am getting the error Call to undefined function method_field() when opening this view, does Lumen not have the @method function? If so, what should I do? Sourc..
Response API 1 $api1 = [ ‘status’ => ‘success’, ‘item’ => [ [‘judul_kontrak’ => ‘proyek 3’], [‘judul_kontrak’ => ‘proyek 4’], [‘judul_kontrak’ => ‘proyek 5’] ] ]; Response API 2 $api1 = [ ‘status’ => ‘success’, ‘item’ => [ [‘nama_proyek’ => ‘proyek 1’], [‘nama_proyek’ => ‘proyek 2’], [‘nama_proyek’ => ‘proyek 3’] ] ]; i have code ..
I got several jobs, processing with lumen C:projectsmyproject (feature-1234 -> origin) $ php artisan queue:work –queue=rate-parse,fetch-tickers,check-markets,make-rates,switch-exchange but sometimes, treatment suddenly interrupted without any errors or messages, and not all queues finished [2020-12-16 10:01:21][22152] Processing: AppJobsSwitchExchange [2020-12-16 10:01:34][22152] Processed: AppJobsSwitchExchange C:projectsmyproject (feature-1234 -> origin) Sourc..
I have the code if there is the same name in 2nd foreach, then the same name is not displayed, but I don’t know how to keep the same name not displayed?. $arr = []; foreach ($respon_tel[‘item’] as $item) { $proyek = [ ‘nama_proyek’ => $item[‘judul_kontrak’], ‘from’ => ‘Another API’ ]; foreach($model as $m){ if(trim(strtolower($item[‘judul_kontrak’])) ..
Different PHP frameworks handle the configurations in different ways. Laravel for example has a .env file whereas Symfony has a file per environment. Both, however, are capable of loading the config from the OS environment variables. In a multi-environment, CI/CD, what is the best place to put the configs? In the OS environment via the ..

Greeting folks. I am playing around with a third party api and I have a field required in lumen like: $this->validate($request, [ ‘url’ => ‘required|string’ ]); but when I send the url in postman i keep getting that it is not sent Anyone knows why it is not recognizing the url sent? Sourc..
in laravel we can use storage Facade in order to save and read files, but in lumen 7.0 there is no filesystem config available at start. what I did so far: composer require league/flysystem in composer.json file, I added the following in autoload section: “files”: [ “app/helpers.php” ], then in app directory, I’ve created helpers.php ..
I am building a web application using Laravel’s lumen framework. I am writing integration and unit tests for my application. I am using Jobs in my application to do heavy tasks in the background, https://laravel.com/docs/8.x/queues. Normally, within the tests, I fake and assert if the job is pushed into the queue as follow. Queue::fake(); Queue::assertPushed(SendEmails::class); ..
my name is Vito from Indonesia. I got stuck and need for help here, hope you can help me to find solution of my problem. So, i would like to upload file from local lumen file. This is my folder architectures : https://i.stack.imgur.com/FVZOL.png If you can solve my problem, please help me.. it means a ..
In my Lumen projet, I have three tables related in this way : Users : has a role Roles : has many scopes Scopes : could be present in many roles I’m trying to get the scopes via the user in this way : $user->role->scopes but I’m getting an empty array knowing that the data ..
I’m trying to use a trait inside an helper function but its throwing error like this Using $this when not in object context this is my helper function namespace AppHelpers; use Log; use Exception; use TwilioRestClient; use AppTraitsHelperTrait; class Twilio { use HelperTrait; static function cdata($hApp){ return response()->json($this->notPdResponse($hApp)); } } Sourc..
I’m using Lumen 8.x. I created a seeder inside a subfolder of database/seeders/. and I created a seeder file inside subfolder. the path database/seeders/tests/TestSeeder.php seeder file <?php namespace DatabaseSeedersTests; class TestSeeder extends BaseSeeder { /** * Run the database seeds. * * @return void */ public function run() { // codes } } composer.json "autoload": ..
I am working in Lumen app and i have created route group like below, $router->group([‘prefix’ => ‘clare’], function() use ($router) { $router->get(‘routetest’, [‘uses’ => ‘[email protected]’]); }); I want to get the current route prefix in ChannelController index method. I don’t know how to do that. I could not find this in documentation for lumen. But ..
I am using Lumen (not full Laravel) and my goal is to generate an HTML file which I can then pass to mPDF to render (or save as file). I’ve been using views as Mailables, where I pass data, load language files, get translations, etc. However this time I just wanted to simplify the whole ..
I’m working on a new lumen project and i’m trying to communicate with it from an angular project. I’ve added a middleware to add the following headers for local requests using a middleware: $response->header(‘Access-Control-Allow-Origin’, ‘*’) ->header(‘Access-Control-Allow-Methods’, ‘GET, POST, PUT, DELETE, OPTIONS’) ->header(‘Access-Control-Allow-Headers’, ‘X-Requested-With, Content-Type, X-Token-Auth, Authorization’); But i still have issue with CORS. localhost/:1 Access ..