Website Portfolio with Laravel and Vue js | Login And Register Sanctum Auth With Vuejs 3

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 8

  • @enthsz8446
    @enthsz8446 Месяц назад

    Just a tip, put on some background music at a low volume and don't talk too close to the microphone

    • @devstrain
      @devstrain  Месяц назад +1

      Thanks you for suggestion ❤

  • @tholfikarmohammed887
    @tholfikarmohammed887 Год назад

    Anyone facing this error:
    Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes.
    While running the migration, you need to add this line in AppServiceProvider in boot function:
    Schema::defaultStringLength(191);
    Don't forget to import the namespace for Schema

  • @tholfikarmohammed887
    @tholfikarmohammed887 Год назад

    when I make a request via post man on register endpoint, it returns a 500 response(Internal Server Error)

    • @yamato23488
      @yamato23488 9 месяцев назад

      run command:
      composer require laravel/sanctum
      php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
      Add this line to your Api.php
      Route::group([
      'namespace' => 'App\Http\Controllers\Api',
      ], function ($router) {
      Route::post('login', 'AuthController@login');
      Route::post('register', 'AuthController@register');
      Route::post('logout', 'AuthController@logout');
      });
      did not show in the video

  • @SaifulIslam-eo5to
    @SaifulIslam-eo5to Год назад

    give me the css for login page

  • @yamato23488
    @yamato23488 9 месяцев назад +1

    router.beforeEach((to, from, next) => {
    if (to.meta.requiresAuth && !localStorage.getItem('token')) {
    next({ name: 'login' });
    } else if (to.meta.requiresAuth === false && localStorage.getItem('token')) {
    next({ name: 'admin' });
    } else {
    next(); // Continue with the navigation
    }
    });