Respect

Member Since 2 Years Ago

Experience Points
3,170
Total
Experience

1,830 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
3
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 1
3,170 XP
Feb
14
2 weeks ago
Activity icon

Started a new Conversation Livewire Wire:model & Wire:click Not Working On But Livewire.emit() Working In Js

Livewire wire:model & wire:click not working on some parts of page i'm using full page livewire componet some parts of my pages not working may work in top page form and not working in bottom page form . i used javascript (alpine js )to to fix problem i used

I'M USING in app.blade.php @include('header') @include('footer') @stack() Is There Problems With These Directives In Livewire

I'M USING in app.blade.php  @include('header') @include('footer') @stack() Is There Problems With These Directives In Livewire ?
///////////////////////////////////////////////////// WOKING
Livewire.emit('saveForm') // It's Woking
/////////////////////// x-model WORKING 
 <input type="text" name="company" size="40" class="form-control" id="company"
                                        x-model="name">
/////////////////////////////////////////////////////// NOT WORKING
   <button type="button" class="btn solid-btn" id="btnContactUs"
                                    wire:click.prevent="saveForm">
                                </button>
////////////////////////////////////////////////////// NOT WORKING 
 <input type="text" name="company" size="40" class="form-control" id="company"
                                        wire:model="name">
--------------------------------------

I'M USING in app.blade.php @include('header') @include('footer') @stack() Is There Problems With These Directives In Livewire ?

Feb
04
1 month ago
Activity icon

Started a new Conversation Laravel Radis Echo Server Event Fired But Listning In Empty With Out Error

Hello Friends Laravel + socketio + laravel echo server - event fired but listing is empty with out errors

// .env
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:GiK44aeGfD2CNyWTL2YWKpnSLyBqidCGYLLSKBYLELw=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_echo_server
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=redis
REDIS_CLIENT=predis
REDIS_PREFIX=
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
MIX_APP_URL="${APP_NAME}"

// event fired and laravel-echo-server tracked it
 event(new UserEvent());
// Code 
<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class UserEvent implements SHouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new Channel('fortest');
    }

    // DATA SENT WITH CHANNEL
    public function broadcastWith()
    {
        return ['key' => 'value',];
    }
}

// laravel-echo-server-start console 
Channel: fortest
Event: App\Events\UserEvent
Channel: fortest
Event: App\Events\UserEvent
// LISTING CODE
 <script src="{{ asset('js/echocompiled.js') }}"></script>
        {{-- THIS IS SOCKET IO CLIENT --}}
        <script src="{{ asset('js/socket.io.min.js') }}"></script>
        <script>
        // LARAVEL ECHO INSTANCE
    console.log(window.location.hostname); // 127.0.0.1
        window.Echo = new Echo({
            broadcaster: 'socket.io',
            host: window.location.hostname + ':6001'
        });
Echo.channel('fortest')
    .listen('.UserEvent', (e) => {
        console.log('listning');
        console.log(e);
    })


        </script>
Activity icon

Started a new Conversation Dose Full Page Livewire SEO Friendly 100% With Out Any Additional Plugins

Hello Friends Will Starting use laravel livewire on big project and client need project SEO Friendly i need use livewire on this project so Dose Full Page Livewire SEO Friendly 100% with out any additional plugins ? Thanks

Jan
28
1 month ago
Activity icon

Replied to Alpine Js This.var Return Undefined When Print It

This is Solved Sorry For Question And Answer may be some one find it useful after i spent 7 hours or deffrent ways

   this.handleQuestion().question = res.data ; // used same function name  to access the properties
Activity icon

Started a new Conversation Alpine Js This.var Return Undefined When Print It

Question And Answer Changed To Be Clear May be some one found it useful

  • x-data="handleQuestion()"

IN JS

<script>
function handleQuestion()
{
    // tojs
    return {
    encyclopedia_cat_id:'',
    encyclopedia_sub_cat_id:'',
    question:'THE QUESTIONS',
	subCats:[],
    onWatchRun(val){


        axios.get('/getencyclopediasubcats/'+ val).then(res => {
           console.log(this.subCats); // undefined
		this.subCats = res.data;
				

        }).catch(err => {
            console.log(err);
        })
    }
    };
}


</script>
Dec
31
2 months ago
Activity icon

Started a new Conversation Modal Close On Start Typing Inside Any Input How To Fix It Using Livewire

Hello Friends Modal Close On Input typing How to fix it using livewire - if i removed wire:name it's wokting correct

  • code
// index.blade.php
<x-slot name="title">@lang('app.dashboard') | @lang('app.categories')</x-slot>
<x-slot name="pageTitle">@lang('app.programs') - @lang('app.categories')</x-slot>
<x-slot name="breadcrumb">
    <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">@lang('app.dashboard')</a></li>
    <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">@lang('app.programs')</a></li>
    <li class="breadcrumb-item active">@lang('app.categories')</li>
</x-slot>
<div class="w-100">
    <div class="d-flex justify-content-between align-items-center">
        <button type="button" class="btn btn-success waves-effect waves-light" data-toggle="modal"
            data-target="#con-close-modal" data-animation="fadein" data-plugin="custommodal">
            <i class="la la-pencil-square-o"></i>
        </button>
        <div class="form-group" style="margin-bottom:0;">
            <input type="text" id="simpleinput" class="form-control" placeholder="@lang('app.search')">

        </div>
    </div>
    <hr>
    <div class="table-responsive">
        <table class="table mb-0 table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th>@lang('app.name')</th>
                    <th>@lang('app.actions')</th>
                </tr>
            </thead>
            <tbody>
                @forelse ($categories as $category)
                <tr>
                    <th scope="row">{{ $category->id }}</th>
                    <th scope="row">{{ $category->translate('name') }}</th>
                    <th>
                        <button title="@lang('app.edit')" type="button"
                            class="btn btn-primary waves-effect waves-light">
                            <i class="la la-edit fz-16"></i>
                        </button>
                        <button title="@lang('app.details')" type="button"
                            class="btn btn-warning waves-effect waves-dark text-black-50">
                            <i class="mdi mdi-eye-circle fz-18"></i>
                        </button>
                        <button title="@lang('app.delete')" type="button"
                            class="btn btn-danger waves-effect waves-dark">
                            <i class="la la-times-circle fz-18"></i>
                        </button>

                    </th>
                </tr>
                @empty
                <div class="alert alert-info text-center">
                    <strong><i class="la la-database"></i></strong>
                    @lang('app.data_not_found')
                </div>
                @endforelse

            </tbody>
        </table>
        {{-- MODAL START --}}
        <div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
            aria-hidden="true" style="display: none;">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header custom-modal-title ">
                        <h4 class="modal-title text-white">@lang('app.create')</h4>
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    </div>
                    <div class="modal-body p-4">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="field-1" class="control-label">@lang('app.name_ar')</label>
                                    <input type="text" wire:model="name_ar" class="form-control" id="field-1">
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="field-1" class="control-label">@lang('app.name_en')</label>
                                    <input type="text" wire:model="name_en" class="form-control" id="field-1">
                                </div>
                            </div>

                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="field-1" class="control-label">@lang('app.name_id')</label>
                                    <input type="text" wire:model="name_id" class="form-control" id="field-1">
                                </div>
                            </div>
                        {{-- <div class="row">
                            <div class="col-md-12">
                                <div class="form-group no-margin">
                                    <label for="field-7" class="control-label">Personal Info</label>
                                    <textarea class="form-control" id="field-7"
                                        placeholder="Write something about yourself"></textarea>
                                </div>
                            </div>
                        </div> --}}
                    </div>
                    <div class="modal-footer d-flex justify-content-between">
                        <button type="submit" class="btn btn-purple btn-lg waves-effect waves-light">@lang('app.save')</button>
                        <button type="button" class="btn btn-danger waves-effect" data-dismiss="modal">@lang('app.close')</button>
                    </div>
                </div>
            </div>
        </div><!-- /.modal -->
    </div>
// index.php

<?php

namespace App\Http\Livewire\Admin\Programcat;

use Livewire\Component;
use App\Models\ProgramCat;

class Index extends Component
{
    public $categories, $name_ar, $name_en, $name_id;
    public $updateMode = false;

    public function mount()
    {
        $this->categories = ProgramCat::latest()->get();
    }
    public function render()
    {
        return view('livewire.admin.programcat.index')->layout(ADMIN_LAYOUT);
    }
}

Thank You So Much

Nov
02
4 months ago
Activity icon

Replied to Auth::LogoutOtherDevices() Not Working

You too Thanks again for everything

Activity icon

Replied to Auth::LogoutOtherDevices() Not Working

THANK YO SO MUCH , YOU GIVE M AN INSPRATION TO FIX IT ,, I changed Default guard from config/auth.php from web to supplier and now it worked,,, TAHNK YOU SO MUCH I will mark your answer

Activity icon

Replied to Auth::LogoutOtherDevices() Not Working

I will test it after i ate my food and back Thanks for tring help me

Activity icon

Replied to Auth::LogoutOtherDevices() Not Working

Did you use it with custom guard like that in config/auth.php laravel 7

      $username = $request->username;
        $password = $request->password;

  if (Auth::guard('supplier')->attempt([
                'username' => $username,
                'password' => $password,
            ])) {
                // LOGOUT OTHER DEVICES
                Auth::guard('supplier')->logoutOtherDevices($password);
                // REDIRECT TO
                return redirect()->route('dashboard');
            }
Activity icon

Replied to Auth::LogoutOtherDevices() Not Working

Did you use it with custom guard like that in config/auth.php

        $username = $request->username;
        $password = $request->password;

  if (Auth::guard('supplier')->attempt([
                'username' => $username,
                'password' => $password,
            ])) {
                // LOGOUT OTHER DEVICES
                Auth::guard('supplier')->logoutOtherDevices($password);
                // REDIRECT TO
                return redirect()->route('dashboard');
            }
Activity icon

Replied to Auth::LogoutOtherDevices() Not Working

YAS It's enabled

Activity icon

Started a new Conversation Auth::LogoutOtherDevices() Not Working

  • I USE IT LIKE THAT BUT NOTHING HAPPEN
        $username = $request->username;
        $password = $request->password;

  if (Auth::guard('supplier')->attempt([
                'username' => $username,
                'password' => $password,
            ])) {
                // LOGOUT OTHER DEVICES
                Auth::guard('supplier')->logoutOtherDevices($password);
                // REDIRECT TO
                return redirect()->route('dashboard');
            }

  • Auth::LogoutOtherDevices() Not Working In Using custom guard
<?php

// config/auth.php

return [



    /*
    |--------------------------------------------------------------------------
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This option controls the default authentication "guard" and password
    | reset options for your application. You may change these defaults
    | as required, but they're a perfect start for most applications.
    |
    */

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

    /*
    |--------------------------------------------------------------------------
    | Authentication Guards
    |--------------------------------------------------------------------------
    |
    | Next, you may define every authentication guard for your application.
    | Of course, a great default configuration has been defined for you
    | here which uses session storage and the Eloquent user provider.
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | Supported: "session", "token"
    |
    */

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],
        'admin' => [
            'driver' => 'session',
            'provider' => 'admins',
        ],
        'supplier' => [
            'driver' => 'session',
            'provider' => 'suppliers',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
            'hash' => false,
        ],
        'api-admin' => [
            'driver' => 'token',
            'provider' => 'admins',
            'hash' => false,
        ],
        'api-supplier' => [
            'driver' => 'token',
            'provider' => 'suppliers',
            'hash' => false,
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | User Providers
    |--------------------------------------------------------------------------
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | If you have multiple user tables or models you may configure multiple
    | sources which represent each model / table. These sources may then
    | be assigned to any extra authentication guards you have defined.
    |
    | Supported: "database", "eloquent"
    |
    */

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],
        'admins' => [
            'driver' => 'eloquent',
            'model' => App\Models\Admin::class,
        ],
        'suppliers' => [
            'driver' => 'eloquent',
            'model' => App\Models\Supplier::class,
        ],

        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Resetting Passwords
    |--------------------------------------------------------------------------
    |
    | You may specify multiple password reset configurations if you have more
    | than one user table or model in the application and you want to have
    | separate password reset settings based on the specific user types.
    |
    | The expire time is the number of minutes that the reset token should be
    | considered valid. This security feature keeps tokens short-lived so
    | they have less time to be guessed. You may change this as needed.
    |
    */

    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 60,
            'throttle' => 60,
        ],
        'admins' => [
            'provider' => 'admins',
            'table' => 'password_resets',
            'expire' => 60,
            'throttle' => 60,
        ],
        'suppliers' => [
            'provider' => 'suppliers',
            'table' => 'password_resets',
            'expire' => 60,
            'throttle' => 60,
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Password Confirmation Timeout
    |--------------------------------------------------------------------------
    |
    | Here you may define the amount of seconds before a password confirmation
    | times out and the user is prompted to re-enter their password via the
    | confirmation screen. By default, the timeout lasts for three hours.
    |
    */

    'password_timeout' => 10800,

];