aavinseth

Member Since 5 Months Ago

Experience Points
610
Total
Experience

4,390 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
0
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
610 XP
Dec
14
1 month ago
Activity icon

Replied to Different Login Pages For User And Admin Without Subdomain

How can I implement this in Laravel 8 which use Jetstream for login? As this video is based on laravel 5.x

Dec
13
1 month ago
Activity icon

Started a new Conversation Different Login Pages For User And Admin Without Subdomain

I have a normal users which can access with and without auth pages and Admin users. I want two different login page for normal user and as well as admin users without sub domain and also maintaining a session means logged in admin user can't access normal users auth pages without loggedin as a normal user.

How can I achieve this?

Dec
12
1 month ago
Activity icon

Replied to Spatie Permission Sync Error

@neilstee should I add guard name in user model?

Activity icon

Started a new Conversation Spatie Permission Sync Error

while syncing permission dynamically based on routes I am getting error

"message": "The given role or permission should use guard `web,auth` instead of `web`.",
    "exception": "Spatie\Permission\Exceptions\GuardDoesNotMatch",
    "file": "D:\xampp\htdocs\project\vendor\spatie\laravel-permission\src\Exceptions\GuardDoesNotMatch.php",
Route::group(['middleware' => ['web','auth']], function () {
	Route::prefix('panel')->group(function () {
		Route::get('/', [HomeController::class, 'index'])->name('home');

		Route::resource('/users', UserController::class);
        Route::resource('/permissions', PermissionController::class);
        Route::resource('/roles', RoleController::class);
	});

	Route::get('/checkout', [CheckoutController::class, 'checkout'])->name('checkout');
	Route::post('/checkout', [CheckoutController::class, 'checkoutsubmit'])->name('checkoutsubmit');
	Route::post('/address', [UserController::class, 'addaddress'])->name('addaddress.submit');
});

but without auth middleware i.e 'middleware' => ['web'] I am not getting any issue

Dec
11
1 month ago
Activity icon

Replied to Access To Multiple Roles

Hey while syncing permission dynamically based on routes I am getting error

"message": "The given role or permission should use guard `web,auth` instead of `web`.",
    "exception": "Spatie\Permission\Exceptions\GuardDoesNotMatch",
    "file": "D:\xampp\htdocs\project\vendor\spatie\laravel-permission\src\Exceptions\GuardDoesNotMatch.php",
Route::group(['middleware' => ['web','auth']], function () {
	Route::prefix('panel')->group(function () {
		Route::get('/', [HomeController::class, 'index'])->name('home');

		Route::resource('/users', UserController::class);
        Route::resource('/permissions', PermissionController::class);
        Route::resource('/roles', RoleController::class);
	});

	Route::get('/checkout', [CheckoutController::class, 'checkout'])->name('checkout');
	Route::post('/checkout', [CheckoutController::class, 'checkoutsubmit'])->name('checkoutsubmit');
	Route::post('/address', [UserController::class, 'addaddress'])->name('addaddress.submit');
});

but without auth middleware i.e 'middleware' => ['web'] I am not getting any issue

Dec
07
1 month ago
Activity icon

Started a new Conversation Not Logging On Update Spatie Activitylog

I am using Spatie activitylog. On updating data is not logging.

Model code

<?php

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;
use Spatie\Activitylog\Traits\LogsActivity;

class Product extends Model
{
	use LogsActivity, Searchable;

	public $asYouType = true;
	protected $table = 'table_name';
	protected static $logFillable = true;
	protected static $logOnlyDirty = true;
	protected static $logUnguarded = true;
	protected static $submitEmptyLogs = false;

	protected $casts = [
		...
	];

	protected $fillable = [
		'stream_id',
		'manufacture_id',
		'name',
		'price',
		'sell_price',
		'sell_percentage',
		'rent_price',
		'rent_percentage',
		'deposit_amount',
		'deposit_percentage',
		'edition',
		'isbn',
		'hsn_code',
		'sku_code',
		'description',
		'table_content',
		'pages',
		'language',
		'width',
		'height',
		'length',
		'weight',
		'weight_unit',
		'max_quantity_allowed',
		'return_max_day',
		'tax_rate',
		'country_origin_id',
		'product_type',
		'sell_type',
		'book_type',
		'product_code',
		'is_active'
	];

	protected static $logAttributes = [
		'stream_id',
		'manufacture_id',
		'name',
		'price',
		'sell_price',
		'sell_percentage',
		'rent_price',
		'rent_percentage',
		'deposit_amount',
		'deposit_percentage',
		'edition',
		'isbn',
		'hsn_code',
		'sku_code',
		'description',
		'table_content',
		'pages',
		'language',
		'width',
		'height',
		'length',
		'weight',
		'weight_unit',
		'max_quantity_allowed',
		'return_max_day',
		'tax_rate',
		'country_origin_id',
		'product_type',
		'sell_type',
		'book_type',
		'product_code',
		'is_active'
	];
}

Controller Code on update

public function update(Request $request, Product $masterbook)
    {
        try {
            $masterbooks = Product::findOrFail($masterbook->id);
            $master_book_id = $masterbook->id;

            DB::beginTransaction();
            try {
                $cdate = date('Y-m-d H:i:s');

                $data = array(
                    'stream_id' => $request->stream,
                    'manufacture_id' => $request->publisher,
                    'name' => $request->name,
                    'edition' => $request->edition,
                    'isbn' => $request->isbn,
                    'description' => $request->description,
                    'table_content' => $request->tablecontent,
                    'pages' => $request->pages,
                    'language' => $request->language,
                    'width' => $request->width,
                    'height' => $request->height,
                    'length' => $request->length,
                    'weight' => $request->weight,
                    'weight_unit' => 1
                );
                $update = Product::where('id',$master_book_id)->update($data);

                if(!$update) {
                    return response()->json(['status'=>'failed','message'=>'Something went wrong! Please try again later']);
                }
                DB::commit();
            } catch (Exception $e) {
                DB::rollback();
                return response()->json(['status'=>'failed','message'=>'Something went wrong! Please try again later']);
            }

            return response()->json(['status'=>'success', 'message'=>'Book '.$request->name.' updated successfully','redirect'=>route('masterbooks.edit', ['masterbook' => $master_book_id])]);
        } catch (ModelNotFoundException $e) {
            return response()->json(['status'=>'failed','message'=>'Something went wrong! Please try again later']);
        }
    }
Dec
04
1 month ago
Activity icon

Started a new Conversation Access To Multiple Roles

I have a different roles master admin, admin, sub admin and users

I have multiple roles master-admin, admin, sub-admin and users

below panel prefix group can be access by master admin, admin and sub-admin

Route::prefix('panel')->group(function () {
    // Access by master admin, admin and sub admin
    Route::get('/home', [HomeController::class, 'index'])->name('home');
    Route::resource('/orders', OrderController::class);
    Route::resource('/contactus', OrderController::class);

    // Access by master admin and admin
    Route::post('/manufacture/status', [ManufactureController::class, 'status'])->name('manufacture.status');
    Route::post('/masterbooks/status', [MasterBookController::class, 'status'])->name('masterbooks.status');
    Route::resource('/faqs', FaqController::class);
    Route::get('/faqs/list/view/{faq_slug}', [FaqController::class, 'faq_list'])->name('admin_faq_details');
    Route::get('/faqs/list/create', [FaqController::class, 'faq_category_list_form_add'])->name('faq_category_list_form_add');
    Route::get('/faqs/list/{id}/edit', [FaqController::class, 'faq_category_list_form_edit'])->name('faq_category_list_form_edit');
    Route::post('/faqs/list/', [FaqController::class, 'faq_category_list_form_add_submit'])->name('faq_category_list_form_add_submit');
    Route::patch('/faqs/list/{id}/edit', [FaqController::class, 'faq_category_list_form_edit_submit'])->name('faq_category_list_form_edit_submit');
    Route::resource('/college', CollegeController::class);
    Route::resource('/media', MediaController::class);

    // Access by master admin only
    Route::resource('/users', UserController::class);
    Route::resource('/abcd', UserController::class);
});

certain pages can only access by master-admin and certain pages can only access by master-admin and admin but not by sub-admin

how can I achieve this?

Nov
19
1 month ago
Activity icon

Started a new Conversation Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' Not Found

While running a migration for renameColumn I am getting the following error. I have also installed a "doctrine/dbal": "^3.0" in required.

Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found

  at D:\xampp\htdocs\project\vendor\laravel\framework\src\Illuminate\Database\MySqlConnection.php:89
     85▕      * @return \Doctrine\DBAL\Driver\PDOMySql\Driver
     86▕      */
     87▕     protected function getDoctrineDriver()
     88▕     {
  ➜  89▕         return new DoctrineDriver;
     90▕     }
     91▕ }
     92▕

  1   D:\xampp\htdocs\project\vendor\laravel\framework\src\Illuminate\Database\Connection.php:894
      Illuminate\Database\MySqlConnection::getDoctrineDriver()

  2   D:\xampp\htdocs\project\vendor\laravel\framework\src\Illuminate\Database\Schema\Grammars\RenameColumn.php:25
      Illuminate\Database\Connection::getDoctrineSchemaManager()

Please help with this issue.

Oct
05
3 months ago
Activity icon

Started a new Conversation Error On Login With Jetstream And Socialite

While loging in, I am getting the error on production in laravel 8 in cpanel.

Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\Models\User given, called in /home/user/public_html/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php on line 385

And when using socialite login, I am getting error

Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\Models\User given, called in /home/user/public_html/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php on line 307

The same code is working fine on local

Sep
25
3 months ago
Activity icon

Replied to GET Method Is Not Supported For Homepage

@sinnbeck when I cache route in production its showing 500 error

Activity icon

Replied to GET Method Is Not Supported For Homepage

Thnx Sinnbeck, running command php artisan optimize:clear helped me

Activity icon

Replied to GET Method Is Not Supported For Homepage

nope this also doesn't help,

I am running as localhost/blog instead of 127.0.0.1:8000

In laravel 7, running like localhost/blog does work, but in v8 its giving error

Activity icon

Started a new Conversation GET Method Is Not Supported For Homepage

I am getting error in fresh installation of laravel 8, MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: HEAD. error comes after running command php artisan route:cache on default page for first time

PFA below link for the error screencast

https://streamable.com/dfq7lw

Steps To Reproduce: composer create-project --prefer-dist laravel/laravel blog Run project localhost/blog/public Run command php artisan route:cache Run project localhost/blog/public error will come (The GET method is not supported for this route. Supported methods: HEAD.)

Sep
23
3 months ago
Activity icon

Replied to MethodNotAllowedHttpException In Laravel 8

I have done all this changes, and the thing is this error is coming only on homepage i.e index page. I am also using Jetstream. Please find the error and route list of index page in below screenshot link

https://snipboard.io/c2Iluj.jpg

Sep
19
3 months ago
Activity icon

Replied to MethodNotAllowedHttpException In Laravel 8

Umm I tried to change the code of my index page with laravel 8 default index page but still same error. Fresh installation of laravel 8 and moving all d stuff from previous is d only option I can see right now.

Sep
18
3 months ago
Activity icon

Replied to MethodNotAllowedHttpException In Laravel 8

I have update only packages to their latest version as per upgrade guide.

Activity icon

Started a new Conversation MethodNotAllowedHttpException In Laravel 8

After updating laravel from 7.x to 8.0.4, I am having MethodNotAllowedHttpException on index page. Even if I comment all the routes except default one in web.php file, still I having this error.

Exact error is

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: HEAD.

and code in routes/web.php is

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
// Homepage
Route::get('/', function () {
    return view('welcome');
})->name('index');

Even I have tried below command but still nothing

php artisan config:cache php artisan route:cache php artisan view:cache

Please help with this

Jul
30
5 months ago
Activity icon

Replied to Old And Error Data Not Showing In Blade In Redirect Back With Input And Validator

My code in view is

@if ($errors->any())
       <div class="alert alert-danger">
               <ul>
                     @foreach ($errors->all() as $error)
                              <li>{{ $error }}</li>
                      @endforeach
               </ul>
        </div>
@endif
Activity icon

Started a new Conversation Old And Error Data Not Showing In Blade In Redirect Back With Input And Validator

I am using laravel 7 and while having an error and old data, its being not showing in blade and I am also applying middleware in routes.

Below is my code in controller

if($validator->fails()) {
        return redirect()->back()->withErrors($validator)->withInput()->with('errormessage', 'Please check the errors');
}