Respect

Respect

Member Since 11 Months Ago

Experience Points
1,970
Total
Experience

3,030 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-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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
1,970 XP
Oct
12
2 months ago
Activity icon

Replied to Hello Friends | How To Make Apply This Logic | Thanks For Help

Thank You So Much For Help And For Your Time

Oct
09
2 months ago
Activity icon

Replied to Hello Friends | How To Make Apply This Logic | Thanks For Help

Thanks You So much Sir For Answer I will Test it If Success I will let you know And Mark The Answer Thanks For Your time

Activity icon

Started a new Conversation Hello Friends | How To Make Apply This Logic | Thanks For Help

Hello Friends First Of All Thank You So Much For trying Help And Thanks for your time
1 - I have These 2 models Stock and Containers
2 - Stock Has Many Containers
3 - Stracuture

// Stock
id
name 
// Container
id
stock_id
quantity
// Examples
// Stock
|id|name|
|1 | Max's Stock|
// Container 
|id|stock_id|quantity|
|1 | 1      |0       |
|2 | 1      |1000    |
|3 | 1      |5000    |
// I NEED HELP TO DO // 
// Pull the quantity  = 3000 form stock containers
// IF you looked at Example | Container quantity number 1 got 0  ignore it
// Go To container 2 to pull  (3000 )it's got 1000  so not enough to Cover 3000
// Merge Container 2 + Container 3 quantities and to can cover  the request ( 3000 ) If Enough Do it
// Show Report  From Which container's quantity pulled  and what quantity pulled from each container
pulled 1000 from container  2 
pulled 2000 from container  3
// The Result Of Table After These Actions should be
|id|stock_id|quantity|
|1 | 1      |0       |
|2 | 1      |0        |  pulled the 1000 from this container quantity So now = 0
|3 | 1      |3000    | pulled 2000 from this container quantity it was ( 5000 ) Now = 3000



Aug
14
3 months ago
Activity icon

Replied to Blade Directive's Not Working

Remove tags Your Are Already in php file If Use AppServiceProvider.php boot Method

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

I casted it to integer Steel Give Me True Or False (1 or 0 ) Instedof number like 3 4 2 THANKS for Your Time

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

Comma, Single Quotes are ok.. this error happend while i copy code to the post only Thanks For Your Time

Aug
08
4 months ago
Activity icon

Replied to How To Display In Blade Views A Single Record Only (Laravel)

Use This

$counter2 = Call::where('counter_id', '2')
                    ->latest('updated_at')
                    ->first();
// in blade file  DIRECT  NO LOOPS
{{ $country2->letter }}  AND {{ $country2->number }}
Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

I did Friend But Type field always return True or false in output Insted Of number \ field values 1,2,3,4 THANKS FOR YOUR TIME -- I dont know why

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

Yas it sat fieldgot now number 3 but keeps return true

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

Yas It set correctly during registration depend on user chose of select menu THANKS FOR YOUR TIME

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

It;s Just Field In User Model Use it To Authorize User depend on type number THANKS FOR YOUR TIME

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

Laravel Framework 5.7.28 | Thanks For Your Time

Activity icon

Replied to How Can I Use Two Different Template For Same Route In Laravel

// Keep It Easy Simple Checking In Controller Do The Job

// Ex
if(auth()->check()){
    
return view('one'); // Will Show If User logedin

}
return view('Two'); // Will Show If User Not Loged In

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

Yas i see All data But Type = true or false | Not The Number That Stored in field Like 1-2-3-4 etc

// Look At Type Please  Type Integer And Return boolean  | THANKS FOR YOUR TIME
{"id":54,"name":"test","email":"[email protected]","type":false,"country_id":1,"city_id":2,"category_id":null,"other_factory_specialty":null,"phone":"11111111111","address":"Nasr City Egypt","email_verified_at":"2019-07-24 19:46:59","is_approved":1,"api_activation_code":null,"api_reset_password_code":null,"api_token":null,"created_at":"2019-07-24 19:34:28","updated_at":"2019-07-24 20:13:11"} 
Activity icon

Replied to How To Logout User When Admin Change His Password

U can use something like

use Illuminate\Support\Facades\Auth;

Auth::logoutOtherDevices('password');

More info visit https://laravel.com/docs/5.8/authentication#logging-out

Activity icon

Replied to Hello Friends | Users Table Field Keeps Return True

{{  auth()->user()->type  }} //  true or false  what ever number in field 
// I NEED CHECK
if(auth()->user()->type == 2){
// GO TO USER page etc
}
if(auth()->user()->type == 1){
// GO TO Admin page etc
}

// migration and model code below No Mutaion or accessors

// USERS migration
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->text('address');
            $table->string('password');
            $table->integer('type'); // 1 admin | 2 user | 3 seller
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}

<?php
// This is User Model Code 


namespace App;

use App\Models\DirectOrder;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable implements MustVerifyEmail
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password', ,', 'address',', 'type', 'category_id', , 'email_verified_at', ''api_reset_password_code', ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
        'remember_token',

    ];

    // HAS MANY RESERVED PRODUCTS
    public function reservedproducts()
    {
        return $this->hasMany('App\Models\ReserveProduct', 'user_id', 'id');
    }

    // HAS MANY WITH OCAZION CART
    public function ocazioncart()
    {
        return $this->hasMany('App\Models\OcazionCart', 'user_id', 'id');
    }

    // HAS MANY DIRECT ORDERS
    public function directorders()
    {
        return $this->hasMany(DirectOrder::class);
    }

    // HAS MANY DIRECT ORDERS
    public function ocazionorders()
    {
        return $this->hasMany('App\Models\OcazionOrder');
    }

    // HAS MANY CART ORDERS
    public function orders()
    {
        return $this->hasMany('App\Models\Order');
    }

    // HAS MANY FACTORY CART ORDERS
    public function factorycartorder()
    {
        return $this->hasMany('App\Models\FactoryCartOrder');
    }

    // HAS MANY INDEVIDAUL CART PRODUCT
    public function indevidualshopcart()
    {
        return $this->hasMany('App\Models\IndevidalShopCart');
    }

    // HAS MANY SPECIL  ORDERS OF PRODUCT
    public function specialorders()
    {
        return $this->hasMany('App\Models\SpecialOrder');
    }

    // HAS MANY SPECIL  ORDERS OFFER OF PRODUCT
    public function specialorderoffers()
    {
        return $this->hasMany('App\Models\SpecialOrderOffer');
    }

    // REVERASE WITH COUNTRY
    public function country()
    {
        return $this->belongsTo('App\Models\Country')->withDefault();
    }

    // REVERASE WITH CATEGORY
    public function category()
    {
        return $this->belongsTo('App\Models\Category')->withDefault();
    }

    // REVERASE WITH CITY
    public function city()
    {
        return $this->belongsTo('App\Models\City')->withDefault();
    }

    // REVERASE WITH CITY
    public function factoryspecialties()
    {
        return $this->belongsToMany('App\Models\FactorySpecialty', 'factory_specialty_user');
    }

    // WISH LIST MORPH
    public function wishlists()
    {
        return $this->hasMany('App\Models\Wishlist');
    }

    public function cart()
    {
        return $this->morphMany('App\Models\Cart', 'cartable');
    }
}

Activity icon

Started a new Conversation Hello Friends | Users Table Field Keeps Return True

Hello Friends My users Table New Fields Called type (integer) values 1 OR 2 OR 3 OR 4 What ever value 1 2 3 4 keeps return true when i echo data or check the role or this type field Insted of numbers Idont Know why (Notw Field Type in mysql is integer not boolean AND no use any casts or mutation )

// When I use 
auth()->user()->type   // return True Or False  Not Number Like 1 or 2 or 3

It was Working Good but i dont know what happen why return true insted of number value 
Jul
03
5 months ago
Activity icon

Replied to Fetch Data From Database Base On Users

List All Data From Model 2 - User Some Condtions to show data ex ) // You Can Use 2 Dieffrant Guards