lumen

Lumen + Dingo + JWT is not instantiable while building

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 12:11:03
问题 I am trying to get a basic working foundation for a Lumen + Dingo Rest API, but I am not able to figure out how to peace is all together. Lumen is working fine, but when I try to add Dingo I get all sorts of errors. From the Dingo documentation I read: Once you have the package you can configure the provider in your config/api.php file or in a service provider or bootstrap file. 'jwt' => 'Dingo\Api\Auth\Provider\JWT' or app('Dingo\Api\Auth\Auth')->extend('jwt', function ($app) { return new

Can't use socialite on lumen 5.2

点点圈 提交于 2019-12-13 08:34:12
问题 Here is my config socialite for lumen but I got error: Fatal error: Call to a member function set() on null Any idea? my AuthController namespace App\Http\Controllers; use Socialite; class AuthController extends Controller { public function redirectToProvider() { return Socialite :: driver('github')->redirect(); } public function handleProviderCallback() { $user = Socialite :: driver('github')->user(); dd( $user ); } } my Route.php $app->get('auth/github', 'AuthController@redirectToProvider')

Lumen throws 500 sometimes when sending API request?

試著忘記壹切 提交于 2019-12-13 07:07:04
问题 I am developing an application using anuglarJs on client side and Lumen in server side for REST API's. My .env configuration given below, APP_ENV=local APP_DEBUG=TRUE APP_KEY=XrPbyRlU5p0szSw5MrAQWwWim8C0MXjT DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=kainfo DB_USERNAME=root DB_PASSWORD= CACHE_DRIVER=file SESSION_DRIVER=file And enabled Dotenv::load(__DIR__.'/../'); in bootstrap/app.php My problem is,sometimes Lumen throws 500 exception and working well on next refresh request. The

How to update requests where multiple db are use and images are involve

大城市里の小女人 提交于 2019-12-13 05:08:50
问题 Tried creating API where a user creates a post that includes the title and cook time of food and they can post up to 2 images in two tables posts and post_images in two different databases. the store function is working perfectly fine but I have no idea regarding update function. I can update all posts data through the postman but images are not getting updated public function store(Request $request) { $post = new Post; $post->setConnection('mysql1'); $user = User::where('id', $request->id)-

Laravel: How to get records by using the pivot table?

孤者浪人 提交于 2019-12-13 03:25:23
问题 I have a many to many relationship between task and users, I am trying to get archived tasks, an archived task is: A task that is_done = 1 A task that was done yesterday or before, not including tasks finished today A user can only see archived tasks that he created or he was assigned to, if a user is assigned to a task, his id is stored in the pivot table For reasons outside the scope of the question, I can only get to users by using the pivot table as shown in Task.php below. Task.php model

Lumen with Nginx returns white page

£可爱£侵袭症+ 提交于 2019-12-13 00:22:41
问题 I'm using the Micro-Framework Lumen and let it run with Vagrant. So simply said: it runs when I call the website with localhost:8000 (default options) but when I try to call it with Nginx under an example URL myawesomewebsite.com then it does just returns a white page. What I tried so far: -> configured the hosts file from windows (added an random IP with the URL address) for instance: 55.55.55.5 myawesomewebsite.com -> configured the homestead.yaml -> installed (of course) Nginx on the

Lumen - mongodb - jenssegers/laravel-mongodb - postman

主宰稳场 提交于 2019-12-12 22:21:00
问题 i have install mongodb on my wamp, C:\wamp64\bin\mongodb\mongodb.3.4\bin , i have add mongodb in the path, and create windows service to launch it when necessary. I have install lumen through composer, and after that i have install: "laravel/lumen-framework": "5.3.*", "barryvdh/laravel-ide-helper": "v2.2.1", jenssegers/laravel-mongodb: "v3.1.3" "jenssegers/mongodb-session": "v1.1.0" Finaly i have install mongodb.dll on my wamp php and add extension=php_mongodb.dll inside the php.ini. And now

Lumen - Change default Storage path

北城以北 提交于 2019-12-12 19:05:44
问题 I'm trying to find out how to change the default storage location (including it's subfolders) on a Lumen project. For several reasons, given the current configuration of the production web server, Lumen throws a permission denied exception when trying to write logs or compile Blade views. The only alternative, without involving the sysadmin, is to move the storage folder to a tmp folder on the webserver. On laravel there seems to be a method called " useStoragePath ", but it doesn't seem to

Why POST Request from POSTMAN returns empty?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 12:16:15
问题 My header in the postman like this : My body like this : In the routes laravel lumen, I check like this : $router->group(['middleware' => 'auth'], function ($router) { ... $router->post('/sales-order', function (\Illuminate\Http\Request $request) { echo '<pre>';print_r($request->all());echo '</pre>';die(); }); }); The result in the postman return empty array like this : How can I solve the error? 回答1: DUDE! I finally realize your parameters is wrong "number": ""123"" you put 2 double quote it

Laravel Lumen change log file name

﹥>﹥吖頭↗ 提交于 2019-12-12 11:07:59
问题 Lumen logs are written to /storage/logs and by default given the name lumen.log . How do I change the file name to say xyz.log ? 回答1: As mentioned in comments the location and the name of the log file is hardcoded. Now if for some compelling reason you want to change it you can always extend Laravel\Lumen\Application class and override getMonologHandler() method. Create a new file Application.php in app folder that looks like namespace App; use Laravel\Lumen\Application as LumenApplication;