Categories
Mastering Development

Laravel canot register for new uses

I am creating a simple login function on my website with a registration feature. The registration feature is functional and users are appearing in the database. However, when I try to register new user, it did not inserted into database and stay on the same page and refresh data in form register. When I enter […]

Categories
Mastering Development

my register.blade don’t seems to work in laravel 6

I use the make:auth to create the register and login controller, then edited the form and validation correctly; <form method=”POST” action=””> @csrf <div class=”form-group row”> <label for=”firstname” class=”col-md-4 col-form-label text-md-right”></label> <div class=”col-md-6″> <input id=”name” type=”text” class=”form-control @error(‘firstname’) is-invalid @enderror” name=”firstname” value=”” required autocomplete=”firstname” autofocus> @error(‘firstname’) <span class=”invalid-feedback” role=”alert”> <strong></strong> </span> @enderror </div> </div> <div class=”form-group […]

Categories
Development

redirect a new user after registration to some page while send them some email

I was trying all of the step from this site : https://vegibit.com/how-to-send-email-to-new-users/ and find some problem in the route, “loginUsingId(1)” it’ll call user id 1 from database and I wan to change it with auto increment. So after a new user registered their self and their data was putted through database they will be taken […]

Categories
Development

Apply laravel validation rule to all fields at once

I have inputs, some of them are array inputs (e.g. <input name=”test[]”>) and some are normal ones. Fields have some specific rules, but all of them share 2 rules together. I want that same validation rule to be applied to all fields instead of copying the same thing again and again for like 10+ fields. […]

Categories
Development

Validation fails even if it has values Maatwebsite Laravel Validation

I’m currently using Maatwebsite collection when processing the import CSV file and validating it as well since I’m having hard time using the ToModel way. Here’s how I validate the csv fields: class ImportRooms implements ToCollection, WithStartRow { public function collection(Collection $rows) { foreach($rows as $row){ \Validator::make($row->toArray(), [ ‘name’ => $row[0], ‘room_code’ => $row[1], ‘user_name’ […]

Categories
Development

Laravel 6: How to pass checkbox value into database user table upon registration

I have created a registration form using Laravel 6 default migration table and Auth register controller. Now I want to have two types of accounts, so I have a added a checkbox to the HTML form. If the checkbox is checked, the account should be of different type than when the checkbox in unchecked. What […]

Categories
Development

laravel5.8 project requires email verification

I am trying to verify emails using smtp and I am getting some errors. Error message received This is my register controller <?php namespace App\Http\Controllers\Auth; use App\User; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use Illuminate\Foundation\Auth\RegistersUsers; class RegisterController extends Controller { /* |————————————————————————– | Register Controller |————————————————————————– | | This controller handles the registration of new […]

Categories
Development Laravel

HasMany relationship doesn’t work in Laravel

I have registration form generated through php artisan make:auth command in Laravel project. I want to customize it a bit by adding functionality that user can select his/her gender when registering. I made genders table that has genders column with two values Man and Woman and also added gender_id column in users table. I hasMany […]

Categories
Development Laravel

Laravel – Trying to get property ‘view’ of non-object, when sending mail

I’m trying to send a validation email to a registering customers email address, but It is giving me the error in question rather than sending the notification email. Any help would be fantastic! Struggling here, dont understand where the object is, and the error is unhelpful af. Thankyou Create user : $validator = Validator::make($request->all(), […]

Categories
Development jQuery Laravel

Laravel validation required_if is not working

I have the email and password fields in which I only want them to be required if the add_user field value is 1. This is my validation: public function rules() { return [ ‘add_user’ => [‘required’], ‘password’ => [‘required_if:add_user,1’, ‘min:8′], ’email’ => [‘required_if:add_user,1′, ’email’, ‘max:255’], ]; } This one is not working, it always errors […]