kea_rajab

Software Engineer at Tanzania

Member Since 1 Year Ago

Arusha

Experience Points
60,020
Total
Experience

4,980 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
554
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 13
60,020 XP
May
01
2 weeks ago
Activity icon

Started a new Conversation Flutter With Laravel 8 As Backend

hi everyone! i have been struggling lately with implementing login in form on a laravel powered site using a flutter fontend for mobile applications... the error is 419 which later is explained as the "CSRF Token mismatch" and the following is the code that am using in the flutter application to send the post request to the login route...

onTap: () async {
                          String phone_number = phonenumberController.text;
                          String password = passwordController.text;
                          var data = {
                            'phone_number': phone_number,
                            'password': password
                          };
                          var res = await  http.post('https://tikety.co.tz/sw/login',
                                            headers: {
                                              'Content-type': 'application/json',
                                              'Accept': 'application/json; charset=UTF-8',
                                            },
                                            body: {
                                              "email": phone_number,
                                              "password" : password
                                            } ) ;
                          print(res.body);
}

so after tapping that button all i receive and what is shown on both the dart devTools and the laravel telescope is a 419 status code... Can anyone help me solve this and resolve the token mismatch issue...? Thanks in advance

Apr
16
1 month ago
Activity icon

Replied to Searchbar Like Laracasts Website

Just in case it will be useful for other developers utilizing laravel, livewire and algolia for search to create a search like the current laracasts search bar.

First, let's deconstruct it to its components, the laracasts search bar is made up of a modal that pops up and then whenever you type in your inputs they are rendered as per the records in the laracasts database on different topics. So, we will create a livewire component which will be a modal and then add some server-side code to enable live rendering for the user's keystrokes...

First, make sure you have installed the algolia dependencies and have the full knowledge on how to use it in a laravel website..

then create a search livewire component,

php artisan make:livewire search

Then, select the livewire/search component and add the following code to that component

<div wire:ignore.self class="modal fade" id="search" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
        <div class="modal-body">
                <div class="input-group">
                    <input wire:model="search" type="text" id="query" value="{{ request()->input('query') }}" class="form-control" placeholder="{{ __('Search') }}" aria-describedby="basic-addon2" name="name">
                    <div class="input-group-append">
                    </div>
                </div>

            </form>
        </div>
        @if ($search!='')
        @foreach ($results as $result)
        <div class="modal-body">
            <div class="row ml-1">
                <a href="your_route_here" class="overlay_center border_radius"><img width="50px" height="50px" src="your_image_source" alt=""></a>
                <div class="ml-3">
                    <h4>your title</h4>
                    <h5>your sub title</h5>
                </div>
            </div>
        </div>
        @endforeach
        @endif
        </div>
    </div>
</div>

after creating this component it will be using livewire to render your results...

In your search livewire class replace it fully with the following code...

<?php

namespace App\Http\Livewire;

use Livewire\Component;
use App\Models\Your_model;

class Search extends Component
{
    public $search= '';
    public $results= [];


    public function render()
    {
        $this->results = Your_model::search($this->search)->get();
        return view('livewire.search');
    }
}

Hope this will be usefull for someone to create awesome search bar like laracasts

Feb
16
3 months ago
Activity icon

Started a new Conversation Scout And Meilisearch Returning Error

I have tried to implement the meilisearch setup and works find on link http://localhost:7700 but the results are the events of my job dispatcher which returns the users table of the user dispatching the job, and this is because i am using queue redis for the job dispatched... when i close the redis server, after this command

php artisan scout:import "App\Models\Bus"

I receive the following error

 Predis\Connection\ConnectionException

  No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]

  at C:\xampp\htdocs\Tikety\vendor\predis\predis\src\Connection\AbstractConnection.php:155        
    151▕      */
    152▕     protected function onConnectionError($message, $code = null)
    153▕     {
    154▕         CommunicationException::handle(
  ➜ 155▕             new ConnectionException($this, static::createExceptionMessage($message), $code)
    156▕         );
    157▕     }
    158▕
    159▕     /**

  1   C:\xampp\htdocs\Tikety\vendor\predis\predis\src\Connection\StreamConnection.php:128
      Predis\Connection\AbstractConnection::onConnectionError("No connection could be made because the target machine actively refused it.")

  2   C:\xampp\htdocs\Tikety\vendor\predis\predis\src\Connection\StreamConnection.php:178
      Predis\Connection\StreamConnection::createStreamSocket(Object(Predis\Connection\Parameters), "tcp://127.0.0.1:6379")

I have tried to change the env QUEUE_CONNECTION=redis to QUEUE_CONNECTION=database but no success... i want to import the data from the database so that the meilisearch can index those records... please help Thanks in advance

Dec
20
4 months ago
Activity icon

Replied to Errors Not Live Rendered In Livewire Component

@marianomoreyra thanks for caring... i am having the following contactform class as my livewire class

<?php

namespace App\Http\Livewire;

use App\Mail\ContactMail;
use App\Models\Contact;
use Illuminate\Support\Facades\Mail;
use Livewire\Component;

class ContactForm extends Component
{

    public $name;
    public $email;
    public $body;
    public $errors;

    public function contact_submit(){

     

        $user = $this->validate([
            'name'=>'required',
            'email'=>'required|email',
            'body'=>'required|max:255',
        ]);

        sleep(2);

        Contact::create([
            'name'=>$user['name'],
            'email'=>$user['email'],
            'body'=>$user['body'],
        ]);

        Mail::to('[email protected]')->send(new ContactMail($user));

        $this->resetForm();

        session()->flash('message', trans('Contact made successfully'));
    }

    public function resetForm()
    {
        $this->name = '';
        $this->email = '';
        $this->body = '';
    }

    public function render()
    {
        return view('livewire.contact-form');
    }
}

while my contact form is as follows

<div>
    @if (session('message'))
    <div class="alert alert-success" role="alert">
                    {{ session('message') }}
    </div>
    @endif
    <form wire:submit.prevent="contact_submit" id="contact" class="getin_form wow fadeInUp" data-wow-delay="400ms" method="POST">
        @csrf
        <div class="row px-2">
            <div class="col-md-12 col-sm-12" id="result1"></div>
            <div class="col-md-12 col-sm-12">
                <div class="form-group">
                    <label for="name1" class="d-none"></label>
                    <input wire:model="name" wire:errors="$errors" class="form-control @error('name') border border-danger @enderror" id="name" type="text" placeholder="{{ __('Name:') }}" required name="name">
                    @error('name')
                    <p style="color:red;">{{ $message }}</p>
                    @enderror
                </div>
            </div>
            <div class="col-md-12 col-sm-12">
                <div class="form-group">
                    <label for="email1" class="d-none"></label>
                    <input wire:model="email" :errors="$error" class="form-control @error('email') border border-danger @enderror" type="email" id="email" placeholder="{{ __('Email:') }}" name="email">
                    @error('email')
                    <p style="color:red;">{{ $message }}</p>
                    @enderror
                </div>
            </div>
            <div class="col-md-12 col-sm-12">
                <div class="form-group">
                    <label for="message1" class="d-none"></label>
                    <textarea wire:model="body" class="form-control" id="body" placeholder="{{ __('Message:') }}" required name="body"></textarea>
                    @if ($errors->any())
                    <p style="color:red;">heeeey</p>
                    @endif
                    @error('body')
                    <p style="color:red;">{{ $message }}</p>
                    @enderror
                </div>
            </div>
            <div class="col-md-12 col-sm-12">
            <button type="submit" id="submit_btn1"
                {{-- data-callback="onSubmit"
                data-sitekey="{{ config('services.recaptcha.key') }}" --}}
                class="button btnsecondary gradient-btn">
                <div class="spinner-border spinner-border-sm text-light align-items-center" role="status">
                    <span  class="sr-only">Loading...</span>
                </div>
                {{ __('Submit') }}
            </button>
            </div>
        </div>
    </form>
    <style>
        .button.btnsecondary.gradient-btn[disabled] {
            background-color: #98d1f2;
        }
    </style>
</div>

thanks in advance

Dec
19
4 months ago
Activity icon

Started a new Conversation Errors Not Live Rendered In Livewire Component

i have three fields having normal input fields and normal [ @error (name) message @enderror ] components for capturing the errors captured during validation, but the ajax requests are being sent correctly but the errors are not thrown when the fields are inserted with data different to the validation rules i have set in the livewire class... am using latest livewire on laravel 8 project... what am i missing? In addition to this, i have tried to hide a spinner using wire:loading, but unfortunately it is behaving strange and the spinner is not hidden as expeted, please help

Activity icon

Replied to Livewire 😒don't Work...

I had the same problem, It seemed that the livewire scripts are not loaded properly and after runing the following command,

php artisan vendor:publish --tag=livewire:config

and edit the config/livewire file

'asset_url'  => null,

to this

'asset_url'  => 'https://yourserver/public',
Activity icon

Started a new Conversation Intergrating Invisible ReCaptcha In Livewire

i have been using the v2 invisible recaptcha in my form, and it was working just fine, untill i decided to intergrate the livewire feature in my forms... and i have encountered a problem when trying to validate the form and the badge of recaptcha seems to dissappear just after some few keystrokes when filling the form... here is my code...

class ContactForm extends Component
{

    public $name;
    public $email;
    public $body;
    public $g_recaptcha_response;

    public function contact_submit(){

        $user = $this->validate([
            'name'=>'required',
            'email'=>'required|email',
            'body'=>'required|max:255',
            'g_recaptcha_response'=>['required', new RecaptchaRule]
        ]);

        Contact::create([
            'name'=>$user['name'],
            'email'=>$user['email'],
            'body'=>$user['body'],
        ]);
...

the contact-form livewire component is as following

<div>
<form wire:submit.prevent="contact_submit" class="getin_form wow fadeInUp" data-wow-delay="400ms" method="POST">
        @csrf
     
                    <input wire:model.lazy="name" class="form-control" id="name" type="text" placeholder="{{ __('Name:') }}" required name="name">
                    
                    <input wire:model.lazy="email" class="form-control" type="email" id="email" placeholder="{{ __('Email:') }}" name="email">
                    
                
                    <textarea wire:model.lazy="body" class="form-control" id="body" placeholder="{{ __('Message:') }}" required name="body"></textarea>        
                <button type="submit" id="submit_btn1"
                data-callback="onSubmit"
                data-sitekey="{{ config('services.recaptcha.key') }}"
                class="g-recaptcha button btn-primary w-100">{{ __('Submit') }}</button>
            
    </form>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
        <script>
        function onSubmit(onSubmit) {
        document.getElementById("{{ $slot }}").submit();
        }
</script>
</div>

i cant get my head around this, what am i missing

Dec
17
4 months ago
Activity icon

Awarded Best Reply on Livewire HELP!!

Solution It seemed that the livewire scripts were not loaded properly and after runing the following command

php artisan vendor:publish --tag=livewire:config

and edit the following

'asset_url'  => null,

in the livewire config file, to

'asset_url'  => 'https://yourserver/public',

solved this problem

Activity icon

Replied to Livewire HELP!!

Solution It seemed that the livewire scripts were not loaded properly and after runing the following command

php artisan vendor:publish --tag=livewire:config

and edit the following

'asset_url'  => null,

in the livewire config file, to

'asset_url'  => 'https://yourserver/public',

solved this problem

Dec
16
5 months ago
Activity icon

Replied to Livewire HELP!!

the component is loading and rendering the view of it correctly but the only problem is that the wire:click functions are not firing at all...

Activity icon

Replied to Livewire HELP!!

i included it in the view of but it is not working

@extends('layout.standard_app')

@section('header_script')
    @livewireStyles
    <x-recaptcha>
        contact
    </x-recaptcha>
@endsection

@section('content')

    <!-- Contact US -->
    <section id="stayconnect1" class="whitebox position-relative padding noshadow">
        <div class="container whitebox shadow-lg">
            <div class="widget py-5 ">
                <div class="row">
                    <div class="col-md-12 text-center wow fadeIn mt-n3" data-wow-delay="300ms">
                        <h2 class="heading bottom30 darkcolor font-light2 pt-1"><span class="font-normal">{{ __('Contact Us') }}</span>
                        </h2>
                        <div class="col-md-8 offset-md-2 bottom35">
                            <p>{{ __('Please, leave us a message') }}</p>
                        </div>
                    </div>
                   
                    <div class="col-md-6 col-sm-6">
                        <div class="heading-title  wow fadeInUp" data-wow-delay="300ms">

                            @livewire('counter')

                            <form id="contact" class="getin_form wow fadeInUp" data-wow-delay="400ms" method="POST" action="{{ route('ContactForm', app()->getLocale()) }}">
                                @csrf
                                <div class="row px-2">
                                    <div class="col-md-12 col-sm-12" id="result1"></div>
                                    <div class="col-md-12 col-sm-12">
                                        <div class="form-group">
                                            <label for="name1" class="d-none"></label>
                                            <input class="form-control" id="name" type="text" placeholder="{{ __('Name:') }}" required name="name">
                                            @error('name')
                                            <p class="danger">{{ $message }}</p>
                                            @enderror
                                        </div>
                                    </div>
                                    <div class="col-md-12 col-sm-12">
                                        <div class="form-group">
                                            <label for="email1" class="d-none"></label>
                                            <input class="form-control" type="email" id="email" placeholder="{{ __('Email:') }}" name="email">
                                            @error('email')
                                            <p class="danger">{{ $message }}</p>
                                            @enderror
                                        </div>
                                    </div>
                                    <div class="col-md-12 col-sm-12">
                                        <div class="form-group">
                                            <label for="message1" class="d-none"></label>
                                            <textarea class="form-control" id="body" placeholder="{{ __('Message:') }}" required name="body"></textarea>
                                            @error('body')
                                            <p class="danger">{{ $message }}</p>
                                            @enderror
                                        </div>
                                    </div>
                                    <div class="col-md-12 col-sm-12">
                                        <button type="submit" id="submit_btn1" data-callback="onSubmit" data-sitekey="{{ config('services.recaptcha.key') }}" class="g-recaptcha button btn-primary w-100">{{ __('Submit') }}</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                                  
                <div class="col-lg-3 col-md-3">
                    <div class="widget text-center top60 w-100">
                        <div class="contact-box">
                            <span class="icon-contact defaultcolor"><i class="far fa-clock"></i></span>
                            <p class="bottom15">UTC−05:00 <span class="d-block">UTC+01:00</span></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    @section('script')
        @livewireScripts
    @endsection
    <!-- Contact US ends -->

@endsection
Activity icon

Started a new Conversation Livewire HELP!!

I need help on incorporating the livewire components in my project and after following some tuts, all i end up with is the value of the public variables in the livewire php class, here are some of my codes This below is that php class...

<?php

namespace App\Http\Livewire;

use Livewire\Component;

class Counter extends Component
{

    public $count = 10000;

    public function inc(){
        dd('hee');
        $this->count++;
    }

    public function dec(){
        $this->count--;
    }

    public function render()
    {
        return view('livewire.counter');
    }
}

and this is the component


<div>
    {{-- A good traveler has no fixed plans and is not intent upon arriving. --}}
    <span>{{ $count }}</span>
    <button wire:click="inc">+</button>
    <button wire:click="dec">-</button>
</div>

and this is the view which am projecting this livewire test component

@extends('layout.standard_app')

@section('header_script')
    @livewireStyles
    <x-recaptcha>
        contact
    </x-recaptcha>
@endsection

@section('content')

    <!-- Contact US -->
    <section id="stayconnect1" class="whitebox position-relative padding noshadow">
        <div class="container whitebox shadow-lg">
            <div class="widget py-5 ">
                <div class="row">
                    <div class="col-md-12 text-center wow fadeIn mt-n3" data-wow-delay="300ms">
                        <h2 class="heading bottom30 darkcolor font-light2 pt-1"><span class="font-normal">{{ __('Contact Us') }}</span>
                        </h2>
                        <div class="col-md-8 offset-md-2 bottom35">
                            <p>{{ __('Please, leave us a message') }}</p>
                        </div>
                    </div>
                    
                    <div class="col-md-6 col-sm-6">
                        <div class="heading-title  wow fadeInUp" data-wow-delay="300ms">

                            <livewire:counter/>
                            
                            <form id="contact" class="getin_form wow fadeInUp" data-wow-delay="400ms" method="POST" action="{{ route('ContactForm', app()->getLocale()) }}">
                                @csrf
                                <div class="row px-2">
                                    <div class="col-md-12 col-sm-12" id="result1"></div>
                                    <div class="col-md-12 col-sm-12">
                                        <div class="form-group">
                                            <label for="name1" class="d-none"></label>
                                            <input class="form-control" id="name" type="text" placeholder="{{ __('Name:') }}" required name="name">
                                            @error('name')
                                            <p class="danger">{{ $message }}</p>
                                            @enderror
                                        </div>
                                    </div>
                                    <div class="col-md-12 col-sm-12">
                                        <div class="form-group">
                                            <label for="email1" class="d-none"></label>
                                            <input class="form-control" type="email" id="email" placeholder="{{ __('Email:') }}" name="email">
                                            @error('email')
                                            <p class="danger">{{ $message }}</p>
                                            @enderror
                                        </div>
                                    </div>
                                    <div class="col-md-12 col-sm-12">
                                        <div class="form-group">
                                            <label for="message1" class="d-none"></label>
                                            <textarea class="form-control" id="body" placeholder="{{ __('Message:') }}" required name="body"></textarea>
                                            @error('body')
                                            <p class="danger">{{ $message }}</p>
                                            @enderror
                                        </div>
                                    </div>
                                    <div class="col-md-12 col-sm-12">
                                        <button type="submit" id="submit_btn1" data-callback="onSubmit" data-sitekey="{{ config('services.recaptcha.key') }}" class="g-recaptcha button btn-primary w-100">{{ __('Submit') }}</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                
                <div class="col-lg-3 col-md-3">
                    <div class="widget text-center top60 w-100">
                        
                    </div>
                </div>
                <div class="col-lg-3 col-md-3">
                    <div class="widget text-center top60 w-100">
                       
                    </div>
                </div>
                <div class="col-lg-3 col-md-3">
                    <div class="widget text-center top60 w-100">
                        <div class="contact-box">
                            <span class="icon-contact defaultcolor"><i class="far fa-clock"></i></span>
                            <p class="bottom15">UTC−05:00 <span class="d-block">UTC+01:00</span></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    @section('script')
        @livewireScripts
    @endsection
    <!-- Contact US ends -->

@endsection
Dec
06
5 months ago
Activity icon

Replied to Integrity Constraint Violation: 1048 Column 'Devicenumber' Cannot Be Null

You can remove an empty row by removing it from the migration table and run the migration fresh command for creating the table afresh in the database, which you will loose your data if in production mode, but if you are still in the tinkering phase, you can just recover your data using the faker package which is used in the factories.

On your case, the framework is telling you that there must be some data in that field or otherwise you can add the nullable() attribute and run the "php artisan migrate:fresh" to make it work

Dec
04
5 months ago
Activity icon

Commented on Allow For Configuration Hooks

@jeffreyway can you create a series on how to create packages, it will be helpfull for most of the developers binging here... thanks in advance

Activity icon

Replied to Building Laravel Packages

@sinnbeck i will give it try

Activity icon

Replied to Building Laravel Packages

Sure, today i was learning on this series and it is why i raised this concern... as you know jeffery always rushes on things which are not concerning the major topic... so i think there is a need for this kind of series or knowledge

Activity icon

Replied to Building Laravel Packages

Thanks for the feedback,... but i would recommend a dedicated series on this community, since its the coolest place to learn web dev...

Activity icon

Started a new Conversation Building Laravel Packages

I have been wondering, if there was a series on how me as a developer can create a laravel package to help other developers utilize it for a particular problem.... if there is no such series... i would love someone to assist me on this... thanks in advance

Activity icon

Replied to Laravel 8.x Login With Phone Number And Not Email

well, i was curious if you can set your own reply as best answer, and among other weird things, before i started paying for laracast, i could mark episodes complete even if i could not see them, and so i wanted to see if you could have two best answers in one question, or can you give yourself a badge of best reply by giving yourself a best reply, it was just my curiosity! and of course if you happen to contact jeffery right away, you can tell him to fix that marking capabilities to users who are not paying... ;)

Nov
28
5 months ago
Activity icon

Replied to Laravel 8.x Login With Phone Number And Not Email

just solved this problem, hope it will help someone,

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = RouteServiceProvider::HOME;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }

    public function username(){
        return 'phone_number';
    }

}

what i missed is changing the view's email input to phone_number

<input id="phone_number" type="text" placeholder="Phone Number:" class="form-control @error('phone_number') is-invalid @enderror" name="phone_number" required  autofocus>

@error('phone_number')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror

thanks @vixo

Nov
27
5 months ago
Activity icon

Replied to Laravel 8.x Login With Phone Number And Not Email

@vixo in my users table am using phone_number as the columns name, i tried this

return 'phone_number';
}

But it just reloads the login page

Activity icon

Started a new Conversation Laravel 8.x Login With Phone Number And Not Email

I have been trying to solve this enigma by trying to override the username function but what it does is just reloading and brings me back to the login and saying "These credentials do not match our records", sign up works just fine but on this nothing progressive happen, also i have tried overriding the credentials, also not bearing any fruits, here is my logincontroller


namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = RouteServiceProvider::HOME;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
        $this->username = $this->findUsername();
    }

    public function findUsername()
    {
        $login = request()->input('email');

        $fieldType = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'phone_number';

        request()->merge([$fieldType => $login]);

        return $fieldType;
    }

}

Please help, i have searched but no where to find the proper answer for this solution.

Nov
23
5 months ago
Activity icon

Replied to Laravel 8 From Scratch?

addition on what @talinon said, you will find the small embedded information at the bottom of every series episode on what has already changed depending on what the series you are learning from, for example, personally i have learned from the series called 'laravel from scratch' which has 68 episodes, and uses a laravel 6 if am not mistaken, but due to the addition of those information and using the laravel documentation, i can say am quite competent on laravel 8. Just go ahead and try out the course. Its fun

Nov
22
5 months ago
Activity icon

Replied to Twilio Verification And User Authentication

Haha, that is just wat i just did... thanks @tisuchi

Nov
19
5 months ago
Activity icon

Replied to Twilio Verification And User Authentication

i can send text with twilio easily but for the case of verification and using it for authentication is the case here

Activity icon

Replied to Twilio Verification And User Authentication

sure, i did it more than two times and all it does is just refresh the page and sends nothing to the phone number, am currently redoing it again, and still have nothing in return

Activity icon

Replied to Twilio Verification And User Authentication

unfortunately, no matter how hard i tried the last link you just gave me, the page keeps refreshing and nothing happens after configuring each and everything as explained by thecodearcher, all of the other links also i have passed through them but, nothing different in particular happened...

Nov
18
5 months ago
Activity icon

Started a new Conversation Twilio Verification And User Authentication

I have been searching for a while, on changing the authentication and verification for users in a website, am using laravel UI --auth, and would love to change it from email to mobile phone number because of the convenience, so far i have find some blog on the twilio site but completely not working, i went for nexmo as an alternative but was not convinced by it and decided to stick with the twilio verify service. My advanced thanks to anyone who will give me a lead on making this thing work out...