Angular2 How to view the backend error message

I want to display the error message in a bootstrap alert. I'm using angular2 as my frontend and lumen as my backend. Frontend <div class="alert alert-danger"> // Display error message here </div> I want the response from the validate

What should I consider in unit testing?

What should I consider when doing a unit test? What steps? What cases? How many tests per function? etc. I would also appreciate information about your experiences. Also I'm working with laravel phpunit. I did an example and it worked: public functio

Lumen reminder on download completed

I created a download route from which my client successfully downloads the file by adding the following code to /app/Http/routes.php: $app->get('/dl', function() use ($app){ return response()->download(getcwd() . "/targetfile"); }); but no

Lumen with arbitrary changes Eloquent all fields

Here's the code: $row = UserFields::where(['user_id' => $user['user_id'], 'field_id' => 'myfield'])->first(); if($row) { $row->field_value = "new value"; $row->save(); } Suddenly all rows field_value in that table changes to the n

Laravel if statement for the request object

Currently building out an API. I am working on an update function with excepts the incoming request. so: api.dev.com/?api_key=asdf&storeid=2 etc now in the backend i am accepting the Request and then i am trying to write some logic to check if the re

Lumen Authentication

Just can't get the Lumen authentication to work at all. I have a fresh install and trying to follow the docs here: https://lumen.laravel.com/docs/5.2/authentication I've Uncommented the AuthProvider line in the app.php file (along with everything els

Frame 0.130 seconds slower than pure PHP - bad?

i've ported a simple PHP project to Laravel and Lumen. The running times (tested with webpagetest.org) until are elements are loaded on the user's machine: PHP-Pur: 0.332 Sec Lumen: 0.363 Sec Laravel: 0.468 Sec Does it make a "big" difference fo

Unable to use Laravel / Socialite with Lumen

I try to use the package Laravel\Socialite in my system in Lumen (5.1) I added this in the config\services.php file : <?php //Socialite 'facebook' => [ 'client_id' => '##################', 'client_secret' => '##################', 'redirect' =&

Converting a laravel application to lumen

So, I have been building a laravel 5.1 API and after months of work on it it dawned on me that I should have been using Lumen all along. Is there a way to convert a laravel app to a lumen app?Lumen is essentially a stripped down version of Laravel. T

Many to many verification of the relationship

I have two models, User and Client, which should be many-to-many relationship. I'm new to lumen/laravel, so I was wondering what would be right way to check if the User belongs to Client ? Let's say I have a $client, and the user $user model, what ki

Get a personalized complaint in jwt-auth laravel

I need help to figure out a issues. I am using lumen(laravel 5.1) for create web services for mobile app. I am using JWT for authentication and it returns a token. First issue is that if i use same token from another system/device then it validated a

Laravel / Lumen: validation and redirection (302)

I am tryng to validate my post input by: public function store(Request $request) { $this->validate($request, [ 'email' => 'required|email|unique:users,email', 'password' => 'required', ]); } and this redirects me to my base url which is odd. I wo

'Request' class not found in the blade

I'm having trouble with blade and the Request class from lumen. To change the class of a menu item I'm calling the 'is' method of the 'Request' class like this: {{ Request::is('thepage/*') ? 'class="active"' : '' }} Sadly everytime I open the pa

Routing old .php URLs to Lumen's own URLs

I'm building a small app that needs to redirect old URLs to the newer and cleaner URLs that Lumen provides. Basically I want to route and possibly giving it a 301 redirect. /something.php?id=1 -> /somethings/1 The problem is this code doesn't seem to

How to use joins in Lumen

I have this query: SELECT fname, gender FROM users, speciality WHERE users.id = userSpeciality.user_id AND type = 2 I want the same query in Lumen. I have tried something like this but it doesnt work: $users = Speciality::join('users', 'users.id', '=

Why cookie is not set in Laravel Lumen

This question is the following of this question. I have a message in my view who says : This site uses cookie [...] Close. When user click on Close, an ajax request is send to the controller. The function is the following : public function acceptCook

Configure OAuth2 in Lumen

I followed this article written to setup OAuth2 for my API that I'm writing in Lumen. I finished setting it up and I implemented the client so that I could test that it works. I haven't been able to get it to work. When I click the 'Login to API' but

Duplicate Response Header (Lumen)

Continuation of: Setting response headers with middleware in Lumen When using the following exception handler in Lumen, the X-Powered-By header is duplicated, even though $replace (the third parameter of the header() method) defaults to true (even se

Lumen - & gt; withErrors ($ validator)

I'm trying to display all errors in div. Controller if ($validator->fails()) { return redirect('/')->withErrors($validator->errors); } View @if($errors->any()) @foreach($errors->all() as $error) {{ $error }} @endforeach @endif And I get: Un

Lumen Micro Framework = & gt; php artisan key: generate

I'm trying out the PHP micro Framework Lumen (from Laravel). One of my first steps was to look into the .env.example file and make a copy of it to have my .env file. There is a variable APP_KEY just like there is in Laravel. Now I tried out the simpl

Redirect to the planned Lumen URL

I'm building a little Lumen application with a simple API & Authentication. I want to redirect the user to the intended URL and if he visits /auth/login by himself I want him to redirect to /foo. In the Laravel Docs there is this function: return red

laravel lumen Entry class not found

Hi im testing lumen new laravel micro-frameword and when i'm trying to get input from a web service im getting this error Fatal error: Class 'App\Http\Controllers\Input' not found in C:\wamp\www\lumen\app\Http\Controllers\WsController.php here is my

How to set the lifetime of a session or cookie at Laravel Lumen

How do I set Cookie/Session life-time in Lumen. In laravel this can be found in the app/config/session.php but since Lumen uses .env file for its configuration, how do I set the life time of sessions? Also when I put a value in a session, Session::pu

Laravel Lumen Memcached not found

Ok, I just started with Lumen and I'm trying to use the Auth, but a call to either Auth::check or any other function of Auth.. leads to the below Error Fatal error: Class 'Memcached' not found in vendor\illuminate\cache\MemcachedConnector.php on line

NotFoundHttpException with Lumen

I've just installed Lumen on Windows and unfortunately I'm getting the following error: NotFoundHttpException in Application.php line 1093: in Application.php line 1093 at Application->handleDispatcherResponse(array('0')) in Application.php line 1063

Lumen does not work out of the box

Just installed Lumen framework. hit the link http://localhost/lumen/public/ in my browser and got this following error, anyone got any idea about it? Traced it back to the app.php file in bootstrap folder. Open your terminal in the root folder run th