Category : lumen

How to call Oracle stored procedure with object type as output parameter? (PLS-00306: wrong number or types of arguments in call) Hello, I am trying to call a stored procedure from PHP Lumen v6.3 which is defined in Oracle as follows: PROCEDURE PRC_REGION_LIST( p_TYPE IN SMALLINT, p_REGION_LIST OUT CT_LST_REGION, p_COD_ERROR OUT NUMBER, p_DES_ERROR OUT VARCHAR2) ..

Read more

I installed a fresh installation of laravel lumen "laravel/lumen-framework": "^8.0" created a controller that returns a view public function register(){ return view(‘register’); } view file <link rel="stylesheet" type="text/css" href="{{asset(‘css/opensans-font.css’)}}" /> im trying to use the asset function but it throws an undefined exception Call to undefined function asset() (View: C:xampphtdocsraziresourcesviewsregister.blade.php) i tried updating and reinstalling ..

Read more

I installed a fresh installation of laravel lumen "laravel/lumen-framework": "^8.0" created a controller that returns a view public function register(){ return view(‘register’); } view file <link rel="stylesheet" type="text/css" href="{{asset(‘css/opensans-font.css’)}}" /> im trying to use the asset function but it throws an undefined exception Call to undefined function asset() (View: C:xampphtdocsraziresourcesviewsregister.blade.php) i tried updating and reinstalling ..

Read more

In my Lumen application I am using the Lumen Passport package to protect my API endpoints. My web.php has implemented the guard the following way: $router->group([‘middleware’ => ‘client.credentials’], function($request) use ($router) { … } With each request a given Bearer Token is sent and validated. My Problem is now, that I don’t want to use ..

Read more

I’m new to PHP and I’m building API for wishlist, for both guest users and logged-in users in Laravel Lumen. Here I’m using TrailManagerService as session manager It saves data as – for logged in users Array ( [trail_id] => 4b19bd9d-f2da-431b-8aba-d181d7eca736 [inception_time] => 1599813465 [last_used] => 1600762156 [customer_id] => 106210 [customer_data.customer_id] => 106210 [customer_data.firstname] => ..

Read more

I got this error message after I made Jobs to send an email "in SendEmail.php line 3" <?php ​ namespace AppJobs; use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateFoundationBusDispatchable; use IlluminateQueueInteractsWithQueue; use IlluminateQueueSerializesModels; use AppMailResetPassword as Reset; use Mail; ​ class SendEmail implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected $reset; /** * Create a new ..

Read more

I wrote a code in Lumen to upload multiple images at once using cloudinary, but the code doesn’t work only the first image gets uploaded. $images = $request->file(‘picture’); $uploaded = []; foreach ($images as $image) { error_log(‘for statement fires.’); Cloudder::upload($image, null, [ ‘folder’ => ‘/dog-lovers’, ‘discard_original_filename’ => true, ]); $image_uploaded = Cloudder::getResult(); array_push($uploaded, $image_uploaded[‘url’]); } ..

Read more

Use case: the client send the time parsed as string in a Json (‘mm:ss:ffff’) to database. Before the difference can be calculated on API. The string must be parsed back at time. I tried this: $timeA = Carbon::createFromFormat(‘mm:ss:SSSS’,($user->timeA)); $timeB = Carbon::createFromFormat(‘mm:ss:SSSS’,($user->timeB)); $result = $timeB->diff($timeA); Postman says: "Unexpected data found. Data missing" Sourc..

Read more

I’m creating an API login for my API application by using JWT. In the default code, JWT use email and password for authenticate. public function login(Request $request){ $credentials = $request->only([’email’, ‘password’]); if (!$token = JWTAuth::attempt($credentials)) { return ‘Invalid login details’; } return $token; } But now, i want to change for login by Phone/Email and ..

Read more

When using Laravel/Lumen: I can apparently reference helper methods like storage_path(), base_path() etc in various PHPUnit test methods, but when I try to reference them in the setUp() method for my test, I receive the following error: Error : Call to undefined method IlluminateContainerContainer::basePath() How does one get these helper methods to work? Is it ..

Read more

I want to add a global scope to my project. and use it in some models. so I create this code: (in app/scopes folder) <?php namespace AppScopes; use IlluminateDatabaseEloquentBuilder; use IlluminateDatabaseEloquentModel; use IlluminateDatabaseEloquentScope; class GameStoreScope implements Scope { /** * Apply the scope to a given Eloquent query builder. * * @param Builder $builder * ..

Read more

Lumen 6.3.4 / PHP 7.3.9 Trying to upload a file from form data. Getting this error: Disk [qr_uploads] does not have a configured driver. bootstrap/app.php $app->configure(‘filesystems’); $app->register(IlluminateFilesystemFilesystemServiceProvider::class); config/filesystems.php <?php return [ ‘local’ => [ ‘driver’ => ‘local’, ‘root’ => storage_path(‘app’), ‘permissions’ => [ ‘file’ => [ ‘public’ => 0664, ‘private’ => 0600, ], ‘dir’ => ..

Read more

I’m import an xlxs file to a collection. However the value in the cells are changes e.g. 3614226905352 changed to 3.614226905369E12 20 to 20.0 500to 500.0 $90.00 to 90.0 ///Controller $import = new ImportFilterService(); Excel::import($import , $file->getRealPath()); class ImportFilterService implements ToCollection { public function collection(Collection $rows) { foreach ($rows as $key => $item) { dd($item); ..

Read more