My login route is
Route::post('/user/login', array('as' => 'userlogin', 'uses' => 'UserController#login'));
I have debug the code line by line on local server , flow is coming in UserController's login function. It is working perfecly fine on the local server , but as i deployed the source on amazon it is throwing an error
NotFoundHttpException in RouteCollection.php line 161
I have tried many solutions but nothing worked for me. Any suggestions in this regard ?
Related
I have been struggling for the past week with this error, and I cannot find one like mine online. I am developing an application with Laravel 9 that let the user log in using the Google Account.
Furthermore, I am no expert using Laravel, so I followed this tutorial online:
https://www.itsolutionstuff.com/post/laravel-9-socialite-login-with-google-account-exampleexample.html
I finished this tutorial and everything seems to work; however, when I log in using a Google Account and receiving the callback this cURL error shows up
"cURL error 7: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://www.googleapis.com/oauth2/v4/token" // app/Http/Controllers/GoogleController.php:55
For more info about my Code, this is the web.php
Route::controller(GoogleController::class)->group(function(){
Route::get('auth/google', 'redirectToGoogle')->name('auth.google');
Route::get('auth/google/callback', 'handleGoogleCallback');
});
services.php
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => 'https://mywebsite.com/auth/google/callback'
]
This error was because SELinux Blocked the Application. It is fixed now.
I have got MethodNotAllowedHttpException when running on online server, but on local server it runs well.
The PHP version is same, the method is used POST.
The other POST methods are runs well except this one.
on blade.php
<form action="{{ route('update.product') }}" method="POST" enctype="multipart/form-data" class="form-horizontal js-form">
on routes/web.php
Route::post('/updateProduct', [
'uses' => 'AdminController#updateProducts',
'as' => 'update.product'
]);
Update:
After I changed the route into 'get'
Route::get('/updateProduct', [
'uses' => 'AdminController#updateProducts',
'as' => 'update.product'
]);
it reach the updateProducts function.
but of course there is no data to process. So, why my post method form sent the get method? and on the browser developer tools I've got POST?
but on my local server it runs well only on online server I've got this issue.
browser dev tools
Can you try using different method if you use laravel collective.
{!! Form::open(['url' => 'client/store','method'=>'post','id'=>'client-register']) !!}
and in route it must be
Route::post('client/store', 'ClientController#store')>name('client.store').
or you can write your action
action="{{URL::to('client/store')}}"
At first see if routes are define properly.
And also you can try clearing the cache using artisan command.
php artisan config:cache
Hope it helps.
This issue occurs due to a missing module extension PDO database on the server, so upload file into the application will throws error.
Installing the module extension will resolve the issue.
I test an laravel 5.6 app running on localhost:8000.
I have a separated vue project (not the one in laravel but external stand alone vue project) running on localhost:8080.
I want external vue to call a route from web.php in laravel:
Route::get('/stores/{store}', 'StoresController#show');
My code in external vue:
axios.get('http://localhost:8000/stores/68')///<-- I do have a record of 68 in database.
.then((response) => {
console.log(self.postdata);
}).catch((err) => {
console.log(err);
});
And I get error:
GET http://localhost:8000/stores/68 net::ERR_CONNECTION_REFUSED
I tried with IP address too:
axios.get('http://192.168.0.142:8000/stores/68')
And still get error:
GET http://192.168.0.142:8000/stores/68 net::ERR_CONNECTION_REFUSED
After much reading, I suspect is because of the csrf-token don't exist in external vue.
How can I resolve this?
Edit:
Below are the screencap of the error from the console:
I tried everything on the internet on error NotFoundHttpException in RouteCollection.php line 161 but it seemed can't to work. I have installed Laravel 5.2 on my computer and XAMPP too. I currently working on project and stuck on phpmyadmin. First, i use php artisan serve and migrate the table to my database and i open http://localhost:8000/phpmyadmin/ and it seemed work. After some work(progress on project like seeding and php), i cant open phpmyadmin on my browser and it says NotFoundHttpException in RouteCollection.php line 161.It works fine when i stop the php artisan serve but when i use it again then it shows error.Can someone tell me how to solve this so i can access my phpmyadmin on browser?
have two different url i mean port for php artisan serve
and local server
some thing like this,
http://localhost/phpmyadmin/
http://localhost:8000/
don't access phpmyadmin from php artisan serve's server
In Implicit call
you should define the route only once, Let me know if it works.
Route::controller('collection','CollectionController');
so now in url collection/home if being parsed then laravel will automatically call getHome() function
My laravel application was working very fine, until I installed entrust.
Now, all my routes which are grouped gives me 500 server error. However, the route when placed out of group gives me the desired result.
Route::get('ticker', 'UsersController#index');
This gives me perfect result.
However, this doesn't.
Route::group(['prefix' => 'api/v1'], function() {
Route::get('ticker', 'UsersController#index');
});
What has gone wrong? I am unable to figure out. I also tried logging errors in apache, but doesn't give me a error in the log file.