How to add some textfield in form register (laravel generator infyom)?

If you want to add some custom field to your registration process because your are using official laravel auth you can add your fields in : /resources/views/auth/register.blade.php and then you can validate and save your inputs in : /app/Http/Controllers/Auth/RegisterController.php you don’t need to add anything to registeruser in vendor because every thing you add will … Read more

Laravel 5.3 auth check in constructor returning false

docs you can’t access the session or authenticated user in your controller’s constructor because the middleware has not run yet. As an alternative, you may define a Closure based middleware directly in your controller’s constructor. Before using this feature, make sure that your application is running Laravel 5.3.4 or above: class ProjectController extends Controller { … Read more

How can I solve incompatible with sql_mode=only_full_group_by in laravel eloquent?

I had a similar Problem and solved it by disabling mysql strict mode in the database connection setting. ‘connections’ => [ ‘mysql’ => [ // Behave like MySQL 5.6 ‘strict’ => false, // Behave like MySQL 5.7 ‘strict’ => true, ] ] You can find even more configuration settings in this blog post by Matt … Read more

Adding Access-Control-Allow-Origin header response in Laravel 5.3 Passport

The simple answer is to set the Access-Control-Allow-Origin header to localhost or *. Here’s how I usually do it: Create a simple middleware called Cors: php artisan make:middleware Cors Add the following code to app/Http/Middleware/Cors.php: public function handle($request, Closure $next) { return $next($request) ->header(‘Access-Control-Allow-Origin’, ‘*’) ->header(‘Access-Control-Allow-Methods’, ‘GET, POST, PUT, DELETE, OPTIONS’); } You can replace … Read more