dembilesmana

dembilesmana

Member Since 8 Months Ago

Experience Points
860
Total
Experience

4,140 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
1
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.

Level 1
860 XP
May
11
1 month ago
Activity icon

Replied to Auth: Sanctum States "Auth Guard [web] Is Not Defined."

Are there any more suggestions?

Activity icon

Replied to Auth: Sanctum States "Auth Guard [web] Is Not Defined."

I have tried, but there is no effect whatsoever.

Activity icon

Replied to Auth: Sanctum States "Auth Guard [web] Is Not Defined."

there seems to be no problem with the config/auth.php file

the message appears when I use 'auth:sanctum'

Activity icon

Started a new Conversation Auth: Sanctum States "Auth Guard [web] Is Not Defined."

I did not understand the message because of what. I have followed the documentation from Laravel and web / YouTube. what they do with me (I think) but they don't get an error message.

routes/api.php:

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
   return $request->user();
});


Route::post('login-api', function (Request $request) {
    $request->validate([
        'email' => 'required|email',
        'password' => 'required',
    ]);

    $user = Client::where('email', $request->email)->first();

    if (! $user || ! Hash::check($request->password, $user->password)) {
        throw ValidationException::withMessages([
            'email' => ['The provided credentials are incorrect.'],
        ]);
    }

    return $user->createToken('percobaan')->plainTextToken;
});

results of postman when accessing /user route:

{
    "message": "Auth guard [web] is not defined.",
    "exception": "InvalidArgumentException",
    "file": "/Users/dele/Documents/GitHub/meal/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php",
    "line": 84,
    "trace": [...]
}
Apr
13
2 months ago
Activity icon

Started a new Conversation Solved

Solved

Apr
04
3 months ago
Activity icon

Awarded Best Reply on Failed To Install Composer And Laravel (macports)

solved, by installing a few of these packages : php74-curl, php74-mbstring, php74-openssl, php74-posix, php74-zip.

Activity icon

Replied to Failed To Install Composer And Laravel (macports)

solved, by installing a few of these packages : php74-curl, php74-mbstring, php74-openssl, php74-posix, php74-zip.

Apr
03
3 months ago
Activity icon

Replied to Failed To Install Composer And Laravel (macports)

I installed everything but there are still errors

PHP Warning:  copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in Command line code on line 1

Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in Command line code on line 1
PHP Warning:  copy(): Failed to enable crypto in Command line code on line 1

Warning: copy(): Failed to enable crypto in Command line code on line 1
PHP Warning:  copy(https://getcomposer.org/installer): failed to open stream: operation failed in Command line code on line 1

Warning: copy(https://getcomposer.org/installer): failed to open stream: operation failed in Command line code on line 1

Activity icon

Replied to Failed To Install Composer And Laravel (macports)

When I was browsing I just got an answer to change the php.ini file but nothing happened.

Activity icon

Replied to Failed To Install Composer And Laravel (macports)

Oh, I forgot to ask, is it different from openssl from php^-openssl, or is it related to each other?

and do I not need to do an extension to php.ini? and is changing the php.ini file recommended? and the php.ini function for what? because before I was browsing and many answers to eliminate the semicolons in extension = openssl. but nothing happened

Activity icon

Replied to Failed To Install Composer And Laravel (macports)

still gets the same error message when installing composer

PHP Warning:  copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
PHP Warning:  copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
PHP Warning:  copy(https://getcomposer.org/installer): failed to open stream: No such file or directory in Command line code on line 1

Warning: copy(https://getcomposer.org/installer): failed to open stream: No such file or directory in Command line code on line 1
Activity icon

Started a new Conversation Failed To Install Composer And Laravel (macports)

Previously I used the hombrew package manager, everything was okay. I reinstalled my iMac, and now I use the Macports package manager.

first I installed the composer and it worked, then installed laravel but failed:

  Problem 1
    - laravel/installer v3.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - laravel/installer v3.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for laravel/installer ^3.0 -> satisfiable by laravel/installer[v3.0.0, v3.0.1]

then I installed the latest version of php using macports, but when I installed the laravel I got this message :

Changed current directory to /Users/DELE/.composer

PHP Fatal error:  Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in phar:///Users/DELE/composer.phar/vendor/symfony/polyfill-mbstring/Mbstring.php:713
Stack trace:
#0 phar:///Users/DELE/composer.phar/vendor/symfony/polyfill-mbstring/bootstrap.php(48): Symfony\Polyfill\Mbstring\Mbstring::mb_strwidth('  [Composer\Exc...', 'ASCII')
#1 phar:///Users/DELE/composer.phar/vendor/symfony/console/Helper/Helper.php(54): mb_strwidth('  [Composer\Exc...', 'ASCII')
#2 phar:///Users/DELE/composer.phar/vendor/symfony/console/Application.php(646): Symfony\Component\Console\Helper\Helper::strlen('  [Composer\Exc...')
#3 phar:///Users/DELE/composer.phar/vendor/symfony/console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(Composer\Exception\NoSslException), Object(Symfony\Component\Console\Output\StreamOutput))
#4 phar:///Users/DELE/composer.phar/src/Composer/Console/Application.php(113): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\StringI in phar:///Users/DELE/composer.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 713

Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in phar:///Users/DELE/composer.phar/vendor/symfony/polyfill-mbstring/Mbstring.php:713
Stack trace:
#0 phar:///Users/DELE/composer.phar/vendor/symfony/polyfill-mbstring/bootstrap.php(48): Symfony\Polyfill\Mbstring\Mbstring::mb_strwidth('  [Composer\Exc...', 'ASCII')
#1 phar:///Users/DELE/composer.phar/vendor/symfony/console/Helper/Helper.php(54): mb_strwidth('  [Composer\Exc...', 'ASCII')
#2 phar:///Users/DELE/composer.phar/vendor/symfony/console/Application.php(646): Symfony\Component\Console\Helper\Helper::strlen('  [Composer\Exc...')
#3 phar:///Users/DELE/composer.phar/vendor/symfony/console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(Composer\Exception\NoSslException), Object(Symfony\Component\Console\Output\StreamOutput))
#4 phar:///Users/DELE/composer.phar/src/Composer/Console/Application.php(113): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\StringI in phar:///Users/DELE/composer.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 713

then I tried to reinstall the composer and get this message :

PHP Warning:  copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
PHP Warning:  copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
PHP Warning:  copy(https://getcomposer.org/installer): failed to open stream: No such file or directory in Command line code on line 1

Warning: copy(https://getcomposer.org/installer): failed to open stream: No such file or directory in Command line code on line 1

Please help.

Mar
28
3 months ago
Activity icon

Replied to How Resolve Route [verification.verify] Not Define?

Because I have a router admin that also uses auth::routes().

so I made the admin and client models. I separate it from the subdomain admin.app.dev and client.app.dev, where each subdomain has a login and register form for clients only.

is there a solution for that?

Activity icon

Replied to How Resolve Route [verification.verify] Not Define?

I understand, but is there no other way like using 'trait' maybe?

or if I make a special notification to replace it can it? if yes how to call it, I have repeatedly read the documentation about the notification but do not understand how to apply it to the problem I am facing this.

Activity icon

Replied to How Resolve Route [verification.verify] Not Define?

thank you for answering, but the purpose of my question is how can I change the value of URL::temporarySignedRoute('verification,verify', <-- change this ....).

because by default laravel calls a route 'verification.verify' whereas I have that route with the prefix name client:: be like this 'client::verification.verify'. because auth::routes() I wrap it in a group with name 'client::'.

Mar
27
3 months ago
Activity icon

Started a new Conversation How Resolve Route [verification.verify] Not Define?

how to change route verification.verify value in laravel?

protected function verificationUrl($notifiable)
{
	return URL::temporarySignedRoute(
		'verification.verify', // Change this in laravel?
		Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
		[
			'id' => $notifiable->getKey(),
			'hash' => sha1($notifiable->getEmailForVerification()),
		]
	);
}

because my route is like this:

Route::domain(config('app.client'))->namespace('client')->name('client::')->group(function () {
    Auth::routes(['verify' => true]);

    Route::middleware(['auth:client', 'verified'])->group(function () {
        Route::get('/', '[email protected]')->name('home');
        Route::get('paying', '[email protected]')->name('paying');
        Route::get('profile', '[email protected]')->name('profile');
        Route::post('profile', '[email protected]')->name('profile.update');
    });
});

so I have the name of the route client::verification.verify not verification.verify

how do i resolve this?

Mar
23
3 months ago
Activity icon

Replied to How To Login With Different Models In Laravel?

I just got the answer at https://medium.com/@nasrulhazim/laravel-using-different-table-and-guard-for-login-bc426d067901

I will digest your answer first

thanks for the answer, you are the best.

Activity icon

Replied to How To Login With Different Models In Laravel?

yes I understand, but I want to separate the client model and the admin model. is there no way to do that in laravel?

and I do not have access to laracast series :(

Activity icon

Started a new Conversation How To Login With Different Models In Laravel?

I have tried to solve this problem for a few days and haven't resolved it yet, hehehe. so please help the masters here please help.

First I change the name user.php to client.php.

Then I made a new model named admin.php.

then in the app/auth.php file I change it to be like this:

    'defaults' => [
        'guard' => 'client',
        'passwords' => 'clients',
    ],

    'guards' => [
        'client' => [
            'driver' => 'session',
            'provider' => 'clients',
        ],

        'admin' => [
            'driver' => 'session',
            'provider' => 'admins',
        ],
    ],

    'providers' => [
        'clients' => [
            'driver' => 'eloquent',
            'model' => App\Client::class,
        ],

        'admins' => [
            'driver' => 'eloquent',
            'model' => App\Admin::class,
        ],
    ],

    'passwords' => [
        'clients' => [
            'provider' => 'clients',
            'table' => 'password_resets',
            'expire' => 60,
            'throttle' => 60,
        ],

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

and this LoginController.php:

    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }

    public function showLoginForm()
    {
        return view('admin.auth.login');
    }

    protected function guard()
    {
        return Auth::guard('admin');
    }

then I tried to log in, and the result was session set, but displaying the login page again (no login failed) it's just that I was not directed to the home page

then I change the auth.php file:

    'defaults' => [
        'guard' => 'admin',
        'passwords' => 'admins',
    ],

then I open http://app.dev/login and I am immediately directed to the homepage, which means I have successfully logged in with a session that was previously saved.

the question: how to login with different models in laravel? or where/how is Illuminate\Foundation\Auth\AuthenticatesUsers; call the defaults array value?

Mar
22
3 months ago
Activity icon

Replied to How AuthenticateUsers Trait From Laravel Built-in Authentication Communicate With User Model?

Has this discussion come to light? because I also stuck here.

Mar
18
3 months ago
Activity icon

Started a new Conversation Direct Each Route('register') To The Domain That Is Currently Being Accessed

I made a multi-app with a codebase style,

I have a problem if I open the login page at admin.app.dev/login the link to register leads to client.app.dev/register that should lead to admin.app.dev/register.

public function map()
{
	$this->mapAdminRoutes();
	$this->mapClientRoutes();
}

protected function mapAdminRoutes()
{
	Route::domain('admin.app.dev')
		->middleware('web')
		->namespace($this->namespace)
		->group(base_path('routes/admin.php'));
}

protected function mapClientRoutes()
{
	Route::domain('client.app.dev')
		->middleware('web')
		->namespace($this->namespace)
		->group(base_path('routes/client.php'));
}

routes/admin.php

Auth::routes();

routes/client.php

Auth::routes();

views/auth/login.blade.php

<a href="{{ route('register') }}">Register</a>

// the link only refers to the route that was last called.
// client.app.dev/register

I want to direct each route('register') to the domain that is currently being accessed

Please help.

Mar
11
3 months ago
Activity icon

Replied to Multi-tenancy Using Laravel App

similarly, I also find it very difficult to understand the tenancy.dev documentation. :(

Mar
09
4 months ago
Activity icon

Started a new Conversation Authenticated Users Are Directed To The Subdomain.

by default the user who successfully logged in will be directed to test.dev/home.

I want to be directed to subdomain.test.dev.

and if the user is not authenticated accessing subdomain.test.dev will be directed to test.dev/login

how do i do that in laravel?