PHP Laravel 5.8 Auth Attempt always return false in PHP 72

Running the same code, request parameter and database on different machine specification resulting different behavior. First one we ran on our sandbox server with specification bellow Centos 7 PHP 7.2 MySQL 5.7 Apache 2.4 returning always false even username and password are correct {“status”:”invalid email”} Secondly, we ran same code, request parameter and database at…

Laravel mass update with different value based on condition

I have a table structure like: id //primary_key value changed_value //on update value column should not be updated instead changed value should be updated status // 0 – default, 1- updated am_id //foreign_key Now, to mass update I am doing as follows: Model::where(‘am_id’,$request->am_id) ->where(‘value’,$request->value) ->update([ ‘changed_value’ => ‘$request->value’, ‘status’ => 1 ]); However, we should…

Laravel model Class not found, but i created the model

When i execute my code that returns: Class ‘app\Nota’ not found I try use app\Notas::all(); instead app\Nota::all();, in the controller, but didn’t work. I try too use app\Notas; instead app\Nota; but didn’t worked for me. My model: <?php namespace App; use Illuminate\Database\Eloquent\Model; class Nota extends Model { // } My controller: <?php namespace App\Http\Controllers; use…

How do I pass a formula from a custom helper file into an Event Listener’s message body in Laravel?

I have a method for calculating volume of water as follows: function getVolumeM3($dgross, $land_size) { return (round($dgross * $land_size)); } Using the above formula I’m getting an integer value which I want to pass into my event listener. My sample event listener is as follows. $ta = calculateTaDuration($user->profile); if (isset($user->phone)) { $message = ‘Dear ‘…

laravel 6 api route 404

I have a route in my laravel app like this, Route::post(‘/user’, ‘UserController@create’); Running php artisan route:list returns, | | POST | api/user | | App\Http\Controllers\UserController@create | api | The test I have for this method/route passes, however if I run a POST via postman I get a 404 error, any ideas why? This is the…

failed to install npm dev / npm watch for Laravel 5.6

i’m working on a project in Laravel 5.6 , i installed npm successfully, bu when i come to run npm run dev or npm run watch i get this error : $ npm run dev > @ dev C:\wamp64\www\QuAn > npm run development > @ development C:\wamp64\www\QuAn > cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js –progress –hide-modules –config=node_modules/laravel-mix/setup/webpack.config.js 11%…