msaad

Member Since 1 Month Ago

Experience Points
590
Total
Experience

4,410 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
590 XP
May
08
1 day ago
Activity icon

Replied to Laravel 8 Shopping Cart Quantity Display Issue

$request->post("qty"); gives right value.

Activity icon

Replied to Laravel 8 Shopping Cart Quantity Display Issue

Yes, I am getting the correct value.

Activity icon

Replied to Laravel 8 Cart Condition Issue

@wakanda Brother do you know the solution to this question:

https://laracasts.com/discuss/channels/laravel/laravel-shopping-cart-quantity

At this time, I need to solve this question.

Thanks

Activity icon

Replied to Laravel 8 Cart Condition Issue

This condition is in Darryldecode:

$condition = new \Darryldecode\Cart\CartCondition(array(
					'name' => 'Mpaisa Discount',
					'type' => 'discount',
					'target' => 'total', 
					'value' => "-".$numberToAdd,
					'order' => 1 
				));
				Cart::condition($condition);
			}

How can we do the same thing in Gloudemans Shoppingcart.

Activity icon

Started a new Conversation Laravel 8 Shopping Cart Quantity Display Issue

Hello Friends, I want to ask about the quantity of an item in the gloveman's shopping cart laravel 8.

In Ajax Form's Data, the item quantity is 1. But when we add that item to the cart then its qty become null.

$item_id = $request->post("item");
		$qty = $request->post("qty");
		$attributes = $request->post("attributes");
		
		$item = DB::table('items')->where('id', $item_id)->get();
		$item_name = $item['0']->name;
		$item_price = $item['0']->price;
		
		Cart::add([
			['id' => $item_id, 'name' => $item_name, 'qty' => $qty, 'price' => $item_price, 'options' => ['attributes' => 					 
     		$attributes]]
		]);

		dd((Cart::content()));

Result of adding item to the cart:

Illuminate\Support\Collection {#1177
  #items: array:1 [
    "6454d2d74156dd45c24fa6411f262489" => Gloudemans\Shoppingcart\CartItem {#771
      +rowId: "6454d2d74156dd45c24fa6411f262489"
      +id: "1628"
      +qty: null
      +name: "Whopper - Meal"
      +price: 12.5
      +weight: 1.0
      +options: Gloudemans\Shoppingcart\CartItemOptions {#1386
        #items: []
      }
      +taxRate: 21
      -associatedModel: null
      -discountRate: 0
    }
  ]
}

Plz, Help Me. Thanks.

May
07
2 days ago
Activity icon

Started a new Conversation Laravel 8 Cart Condition Issue

How Can we apply condition on the Gloudemans\Shoppingcart as we can apply in \Darryldecode\Cart

https://github.com/darryldecode/laravelshoppingcart#conditions

Plz, Help me. Thanks

Activity icon

Replied to Laravel Shopping Cart

I also want to ask that Gloudemans Shoppingcart supports laravel 8 or not

May
06
3 days ago
Activity icon

Started a new Conversation Laravel Shopping Cart

Hello Friends, I want to ask that I am using the cart package in laravel.

in Controller:

use Gloudemans\Shoppingcart\Cart;

  Cart::add([
            ['id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 10.00, 'weight' => 550],
            ['id' => '4832k', 'name' => 'Product 2', 'qty' => 1, 'price' => 10.00, 'weight' => 550, 'options' => ['size' => 'large']]
        ]);

it shows this msg with curly lines below the code:

The non-static method 'add' should not be called statically.intelephense(1036

in vs code

What Is the Reason Plz Help Me?

Activity icon

Replied to Cart Package Issue In Laravel

Thanks, @martinbean. Sorry, I miss this line and do the whole process. Can you suggest to me the shopping cart for laravel 8.

Activity icon

Started a new Conversation Cart Package Issue In Laravel

hello, Friends I want to ask about the cart system package in laravel 8.

I follow this: https://github.com/darryldecode/laravelshoppingcart

Using Below Commands:

composer require "darryldecode/cart"


Darryldecode\Cart\CartServiceProvider::class


'Cart' => Darryldecode\Cart\Facades\CartFacade::class

Now I am using:

use Darryldecode\Cart\Cart;

\Cart::add(array(
			'id' => $item->id,
			'name' => $item->name,
			'price' => $price,
			'quantity' => 1,
		));

It gives error:

Undefined type 'Cart'.

I also try:

Cart instead of \Cart

use Cart instead of use Darryldecode\Cart\Cart;

But it does not work. Plz Help Me.

Activity icon

Replied to Foreach Loop Issue In Laravel 8

Thanks, @martinbean For Helping Me.

Activity icon

Started a new Conversation Foreach Loop Issue In Laravel 8

Hello, Friends;

I want to get data by foreach loop. Data is displayed on the frontend but it is displaying the same data more than 1 time.

My Code:

Controller;

$data['items'] = Item::with(['attributes', 'addons'])->where('items.users_id', '=', $data['food']['0']->users_id)->get();

 return view('food_listing', $data);

Blade File:

@foreach($items as $restaurants_items)
@php
$atType = $restaurants_items->attributes()->orderBy('id','ASC')->select('type','name')->get();
@endphp

@foreach($atType as $typeAt)

@php
echo "<pre>";
print_r($typeAt->name);
@endphp

@endforeach
@endforeach

Result

Choose Spice Level
 Full Spicy
 Medium Spicy
 Low Spicy

Choose Spice Level
 Full Spicy
 Medium Spicy
 Low Spicy

Choose Spice Level
 Full Spicy
 Medium Spicy
 Low Spicy

Choose Variant
 Mild
 Medium

Choose Variant
 Mild
 Medium

I Just Want To Show The Data Like:

Choose Spice Level
 Full Spicy
 Medium Spicy
 Low Spicy

Choose Variant
 Mild
 Medium

Plz, Help Me. Thanks

May
05
4 days ago
Activity icon

Replied to Laravel Eloquent: Relationships Issue

Thanks, @corvs Your Answer Helps Me. It solved my problem.

Activity icon

Replied to Laravel Eloquent: Relationships Issue

These Are my relationships plz check them.

Activity icon

Replied to Laravel Eloquent: Relationships Issue

App\Model\Item (relationships)

public function attributes()
{
	return $this->belongsToMany('App\Models\Attribute', 'items_has_attributes', 'items_id', 'attributes_id')->withPivot('price');
}

public function addons()
{
	return $this->belongsToMany('App\Models\Addon', 'items_has_addons', 'items_id', 'addons_id')->withPivot('price');
}

App\Model\ItemHasAddons (relationships)

public function addon()
{
    return $this->belongsTo('App\Models\Addon', 'addons_id');
}


public function item()
{
    return $this->belongsTo('App\Models\Item', 'items_id');
}

App\Model\ItemHasAttributes (relationships)

public function attribute()
{
    return $this->belongsTo('App\Models\Attribute', 'attributes_id');
}


public function item()
{
    return $this->belongsTo('App\Models\Item', 'items_id');
}

App\Model\Addon (relationships)

 public function attribute()
{
    return $this->belongsTo('App\Models\Attribute');
}

App\Model\Attribute (relationships)

 public function addons()
{
    return $this->hasMany('App\Models\Addon');
}
Activity icon

Started a new Conversation Laravel Eloquent: Relationships Issue

Hello, Friends

I Want Ask About Laravel Eloquent: Relationships. I want to get data by Laravel Eloquent: Relationships but cannot understand the scenario to get data.

I Have the Following Tables:

  1. Items
  2. Items_attributes
  3. Items_addons
  4. Items_has_attributes
  5. Items_has_addons

In the items table, we have all products.

In the items_attributes table, we have all attributes names.

In the items_addons table, we have all addon names.

In the items_has_attributes table, we have all items attributes(attribute_id) with items_id.

In the items_has_addons table, we have all items addons(addons_id) with items_id.

Now we want to select all attributes & addons of every item stored in the items table and their attributes & addons stored in the items_has_attributes & items_has_addons table according to id.

How can I get the name of attributes & addons of every item from the attributes & addons table in laravel using Eloquent: Relationships?

if any other best way so plz suggests me. Thanks.

May
02
1 week ago
Activity icon

Replied to Laravel Project Start Error On Localhost

Thanks, Brother, when I run

composer require grimzy/laravel-mysql-spatial:^4.0

This is the result :

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires pusher/pusher-php-server ^7.2|^8.5|^9.3, found pusher/pusher-php-server[dev-master, dev-psalm_check, 2.1.2, ..., 2.6.4, 3.0.0, ..., v3.4.1, v4.0.0, ..., v4.1.5, v5.0.0, ..., 5.0.x-dev (alias of dev-master), 6.0.0, 6.0.1, 6.1.0] but it does not match the constraint.
  Problem 2
    - Root composer.json requires reliese/laravel ^0.0.13 -> satisfiable by reliese/laravel[v0.0.13].
    - reliese/laravel v0.0.13 requires illuminate/support ~5.1 -> found illuminate/support[v5.1.1, ..., 5.8.x-dev] but it conflicts with another require.
  Problem 3
    - barryvdh/laravel-cors[v0.11.4, ..., 0.11.x-dev] require illuminate/support ^5.5|^6 -> found illuminate/support[v5.5.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev] but it conflicts with another require.
    - barryvdh/laravel-cors v0.11.3 requires illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x -> found illuminate/support[v5.5.0, ..., 5.8.x-dev] but it conflicts with another require.
    - Root composer.json requires barryvdh/laravel-cors ^0.11.3 -> satisfiable by barryvdh/laravel-cors[v0.11.3, v0.11.4, 0.11.x-dev].


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Activity icon

Replied to UpdateHelper\ComposerPlugin Error In Laravel

Hi @mvd I want to ask that I am also facing an error on the GoDaddy server. When I save my login route. It shows an invalid path instead of showing successfully save.This only happens with the login controller. Register controller works perfectly. This also happens with the login blade but the register blade works perfectly.

Can you Know the reason?

Activity icon

Started a new Conversation Laravel Project Start Error On Localhost

Hello Friends, When I Run

PHP artisan serve

It Gives Error:

In ProviderRepository.php line 208:

 Class "Grimzy\LaravelMysqlSpatial\SpatialServiceProvider" not found

How can I solve this Plz Help.

May
01
1 week ago
Activity icon

Started a new Conversation UpdateHelper\ComposerPlugin Error In Laravel

Hello Friends,

I Just Recieve An Old Website Code For Debugging, This Website Is In Laravel, and the version of laravel is old.

I am Facing this error:

Root composer.json requires PHP ^7.3 but your PHP version (8.0.0) does not satisfy that requirement [duplicate]

So I solve this problem from this:

https://stackoverflow.com/questions/65454412/root-composer-json-requires-php-7-3-but-your-php-version-8-0-0-does-not-satis

After That when I run following command:

composer install --ignore-platform-reqs

It Gives Error:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on the current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Package operations: 1 install, 0 updates, 0 removals
  - Installing kylekatarnls/update-helper (1.2.0): Extracting archive
PHP Fatal error:  Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in L:\Live\cyberfood\vendor\kylekatarnls\update-helper\src\UpdateHelper\ComposerPlugin.php on line 11

Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in L:\Live\cyberfood\vendor\kylekatarnls\update-helper\src\UpdateHelper\ComposerPlugin.php on line 11

So Because of it, I run the following command: composer update It Gives Error:

PHP Fatal error:  Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in L:\Live\cyberfood\vendor\kylekatarnls\update-helper\src\UpdateHelper\ComposerPlugin.php on line 11

Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in L:\Live\cyberfood\vendor\kylekatarnls\update-helper\src\UpdateHelper\ComposerPlugin.php on line 11

OR Execution of this command also gives the same(above) Error:

composer update kylekatarnls/update-helper

So plz help me How Can We Fix It? Thanks.

Apr
16
3 weeks ago
Activity icon

Replied to How To Generate Custom Image From Username First Letter In Laravel 8

Thanks, For Helping Me. I Don't Know About This Website.

Activity icon

Started a new Conversation How To Generate Custom Image From Username First Letter In Laravel 8

Hello, Friends I Want To Generate a Custom Image From the First Letter of the Username.

I Search For it And Get The Following Code But It Can't Work For Me.

     use Intervention\Image\Facades\Image;

	        $img = Image::make('/storage/media/user_img/default.png');
            $img->text('HW', 125, 80, function ($font) {
                $font->file(public_path('/fonts/font.ttf'));
                $font->size(40);
                $font->color('#fdf6e3');
                $font->align('center');
                $font->angle(45);
            });
            $filename = time() . '.' . 'jpg';
            $img->resize(150, 150)->save('/storage/media/user_img/' . $filename);

The Error is:

Intervention\Image\Exception\NotReadableException

Image source not readable

config > app.php

 'providers' => [
        Intervention\Image\ImageServiceProvider::class,
    ],
'aliases' => [
    'Image' => Intervention\Image\Facades\Image::class,
],

Plz, Help Me. Thanks