Aqeel94321

Aqeel94321

Member Since 11 Months Ago

Lahore

Web developer at COMSATS university Islamabad,Lahore Campus

Experience Points 1,280
Experience Level 1

3,720 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 Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

20 Apr
2 months ago

Aqeel94321 left a reply on Update Controller

@SNAPEY - can you explain through code?

Aqeel94321 left a reply on Update Controller

@TYKUS - How can i achieve this using foreach loop.

Aqeel94321 left a reply on Update Controller

@TYKUS - Here is result of dd(request->all()) address, city ,state,zipcode and phone are array of multiple value... and i want to store that value using one to many relation.. Code you send me just create new record in database..

array:14 [▼
  "_token" => "HrIJPCKLlET0h1loU8Jgnjh426oivULmbjiOuGu5"
  "_method" => "POST"
  "name" => "Len Lott"
  "description" => "Corrupti qui deseru"
  "address" => array:3 [▼
    0 => "drg gj fdg "
    1 => "In veniam fugiat d"
    2 => "sfsfsf"
  ]
  "city" => array:3 [▼
    0 => "dgsdvb"
    1 => "Beatae est enim cill"
    2 => " cvxc"
  ]
  "state" => array:3 [▼
    0 => "India"
    1 => "Natus odio corporis"
    2 => "pak"
  ]
  "zipcode" => array:3 [▼
    0 => "5000"
    1 => "32116"
    2 => "5400"
  ]
  "phone" => array:3 [▼
    0 => "+17586823343"
    1 => "+1 (656) 727-4287"
    2 => "+913024454608"
  ]
]

Aqeel94321 left a reply on Update Controller

@TYKUS - I have two table one is companyinfo and other is locations. these table have one to many relation. and i want to handling in one form.. for example company have many location. So i want to update my record to add new location. and updated previous one.

Aqeel94321 left a reply on Update Controller

@TYKUS - For that time i don't validate the request. just want to record add in database. you can correct my mistake. I have issue in record updation, i want check DB and if record have then its record updated other create new record. Thanks for your reply @

Aqeel94321 left a reply on Update Controller

@TYKUS - I just make a if check, for checking the request have following array if have arrays then come to next step for loop. otherwise just save and redirect to specify route.

Aqeel94321 left a reply on Update Controller

@TYKUS - in which i just conform the request have following arrays.

Aqeel94321 started a new conversation Update Controller

I have issue related to one to many relation in update method.In update i want to check value from database. if value have then update it otherwise create new one. here is my code

$companyinfo =CompanyInfo::find($id) ;
        if ($request->file('image')){
            File::delete($companyinfo->image);
            $imageName = time().'.'.request()->image->getClientOriginalExtension();
            request()->image->move(public_path('slider/image'), $imageName);
            $companyinfo->image = 'companylogo/image/'.$imageName;
        }

        $companyinfo->name = $request->name;
        $companyinfo->description = $request->description;
        $companyinfo->save();

        $count=count($request->address);
        if ($request->address && $request->city && $request->state && $request->zipcode && $request->phone) {
            for( $i=0; $i<$count;$i++) {
                $masterList = $companyinfo->locate()->where('company_info_id',$request->id)->first();
                if($masterList!=null){
                    $companyinfo->locate()->where('company_info_id', $request->id)->update([
                        'company_info_id' => $companyinfo->id,
                        'address' => $request->address[$i],
                        'city' => $request->city[$i],
                        'state' => $request->state[$i],
                        'zipcode' => $request->zipcode[$i],
                        'phone' => $request->phone[$i],
                    ]);
                }
                else{
                    $companyinfo->locate()->create([
                        'company_info_id' => $companyinfo->id,
                        'address' => $request->address[$i],
                        'city' => $request->city[$i],
                        'state' => $request->state[$i],
                        'zipcode' => $request->zipcode[$i],
                        'phone' => $request->phone[$i],
                    ]);
                }

            }
        }
29 Dec
5 months ago

Aqeel94321 left a reply on Check Method(get And Post) Route In Laravel 5.7

@GLOBALS - That's my requirement but i want this in view.

Aqeel94321 left a reply on Check Method(get And Post) Route In Laravel 5.7

@REALRANDYALLEN - No your answer was not Fulfill my requirement.I want to display all route that have type "GET".

Aqeel94321 started a new conversation Check Method(get And Post) Route In Laravel 5.7

Hello! Can anyone have knowledge about how to check all routes that have method "get" and also "post"??

Thanks in advance :)

09 Nov
7 months ago

Aqeel94321 left a reply on Column Not Found: 1054 Unknown Column '0' In 'field List' (SQL: Insert Into `product_order` (`0`, `order_id`, `product_id`) Values (172, 21, Price))

@SNAPEY - @snapey i want to save my order credential from cart and i handle cart functionality using session.and know i want to save data which i need due to this reason i fetching this way.. can you suggest an other way with example??

Aqeel94321 started a new conversation Column Not Found: 1054 Unknown Column '0' In 'field List' (SQL: Insert Into `product_order` (`0`, `order_id`, `product_id`) Values (172, 21, Price))

where is problem?

$order = new Order();
            $order->user_id = Auth::user()->id;
            $order->totalquantity = $cart->totalQty;
            $order->totalprice = $cart->totalPrice;
            $order->address = $request->input('address');
            $order->name = $request->input('name');
            $order->payment_id = $charge->id;
            $order->save();

            $arr=array_values($cart->items );
            $arr_quantity=array();
            $arr_price=array();
            $arr_id=array();
            for ($i = 0; $i <count($arr) ; $i++){
                array_push($arr_quantity, $arr[$i]['qty'] );
                array_push($arr_price, $arr[$i]['price'] );
                array_push($arr_id, $arr[$i]['item']->id );
            }

            $order->product()->attach('product_id',$arr_id);
            $order->product()->attach('price',$arr_price);
            $order->product()->attach('quantity',$arr_quantity);

Aqeel94321 started a new conversation Store Cart Item In Order Table Using Many To Many Relation.

i am confuse about how to get values from items array and store in orders table

if (!Session::has('cart')) {
            return redirect()->route('home');
        }
        $oldCart = Session::get('cart');
        $cart = new Cart($oldCart);
        dd($cart);

Here is DD result of my cart and how to qty and price and item->product->id

Cart {#773 ▼
  +items: array:2 [▼
    2 => array:4 [▼
      "qty" => 3
      "price" => 1146.0
      "image" => null
      "item" => Product {#629 ▶}
    ]
    1 => array:4 [▼
      "qty" => 2
      "price" => 344.0
      "image" => null
      "item" => Product {#630 ▶}
    ]
  ]
04 Nov
7 months ago

Aqeel94321 started a new conversation Theme Selection From Menu FaCuZ/laravel-theme

i'm using FaCuZ/laravel-theme and make five theme but at that time i dont know how to select a theme from menu to user and that theme activated.

Aqeel94321 left a reply on FaCuz Laravel-theme (Theme Extending)

@D9705996 I read documentation but know my question is how to make selection of theme in menu that selected from user and at a time only one theme activate? Thanks in advance

29 Oct
7 months ago

Aqeel94321 started a new conversation One To Many Relationship Does Not Update.

I have one to many relationship between two table but add data is done but i face problem with edit data .....plz help.

       $fields = Field::find($id);
        $fields->fieldname = $request->fieldname;
        $fields->save();

//     dd($request->all());
               
        $arr = array();
        foreach ($request->extraoption as $value) {
            array_push($arr, $value);
        }
        foreach ($fields->extra_option()as $extraoptions)
        {
            $extraoptions->extraoption= $arr;
            $extraoptions->save();
        }

Thanks in Advance :)

23 Oct
8 months ago

Aqeel94321 started a new conversation Failed To Execute Laravel Command Php Artisan Serve.?

Here is error how to fix it?

Illuminate\Routing\Router::loadRoutes(): Failed opening required 'C:\xampp\htdocs\ElitePlanner-V1\routes/api.php' (include_path='C:\xampp\php\PEAR')

Aqeel94321 started a new conversation Multiple Database Migrate:fresh At One Time

How to migrate:fresh of multiple db at one time? any way to do this???

17 Oct
8 months ago

Aqeel94321 started a new conversation FaCuz Laravel-theme (Theme Extending)

A.o.a! I develop a web project which has only one back-end but have multiple theme.. I found laravel pkg for this. https://github.com/FaCuZ/laravel-theme . And anyone have knowledge how to use this package please help with demo. Thanks.

11 Oct
8 months ago

Aqeel94321 started a new conversation Database Table Column Names In View : Laravel

How to show table attribute in a select selector in a view using controller. i got attribute name but how to show in a view.?

array:20 [▼
  0 => "id"
  1 => "type"
  2 => "title"
  3 => "first_name"
  4 => "middle_initial"
  5 => "last_name"
  6 => "preferred_name"
  7 => "address"
  8 => "city_town"
  9 => "country"
  10 => "post_code"
  11 => "start_date"
  12 => "date_of_birth"
  13 => "last_call_date"
  14 => "service_priority"
  15 => "branch"
  16 => "area"
  17 => "status"
  18 => "created_at"
  19 => "updated_at"
]

now how to show in view these attributes in select option.

04 Oct
8 months ago

Aqeel94321 left a reply on Multiple Database In Laravel Project

@D9705996 Like we have customer and employee main entities for database. customer have more than 100 tables as well as employee also. relationship between customer and employee is many to many relationship. i want to make separate customer db with name of dbcustomer and employee db with name of dbemloyee. if i don't make separate databases then there will be more than 300 tables in one database. so what is best approach to make all tables in on database or in different databases.

Aqeel94321 left a reply on Multiple Database In Laravel Project

@D9705996 I'm on initial stage so i just want to know that I've 350+ tables and want to separate each module with there separate DB to avoid confusion because each module can have same table attributes, Is this a good approach to get started or just create one DB?

Aqeel94321 left a reply on Multiple Database In Laravel Project

@Cronix I have 350+ table in my database and I have 5 modules what do you Suggest me which is best approach to handle these tables with one or multiple databases.

Aqeel94321 left a reply on Multiple Database In Laravel Project

@D9705996 Thanks. Its helpful for me..

how to make relations between two model which belongs to different databases?

Aqeel94321 left a reply on Multiple Database In Laravel Project

@D9705996 @Cronix how to use primary key of table in default database as foreign key in another table of diffrent database in laravel. it will be very helpful thanks

03 Oct
8 months ago

Aqeel94321 left a reply on Multiple Database In Laravel Project

@D9705996 what about if we have 2 to 3 hundred of tables and have performance issue so what your's suggestion ?

Aqeel94321 started a new conversation Multiple Database In Laravel Project

How to use multiple database in laravel ? Is it best approach or not? briefly explain with related work if any.. Thanks

18 Aug
10 months ago

Aqeel94321 started a new conversation Nested Comment In Laravel Using LazyChaser

A.o.a! i,m building a laravel nested comment , and my problem is when i,m click on reply button then all reply button show form. but i,m want of form that are related to comment id.

Show comment View

    {{$products->title}}
    {{$products->description}}
    <hr/>
    <h4>Display Comments</h4>
    @include('partials._comment_replies', ['comments' => $products->comments, 'product_id' => $products->id])
    <hr/>
    <h4>Add comment</h4>
    <form method="post" action="{{ route('comment.add') }}">
        @csrf
        <div class="form-group">
            <input type="text" name="comment" class="form-control"/>
            <input type="hidden" name="product_id" value="{{ $products->id }}"/>
        </div>
        <div class="form-group">
            <input type="submit" class="btn btn-warning" value="Add Comment"/>
        </div>
    </form>

My reply view

@foreach($comments as $comment)
    <div class="display-comment">
        <img src="Images/default.jpg" alt="alt">
        <strong>{{ $comment->user->name }}</strong>
        <p>{{ $comment->comment }}</p>
        <a href=".reply" data-toggle="collapse">reply</a>
        <div class="reply-comment">
            @foreach($comment->children as $commentss)
                <p>{{ $commentss->comment }}</p>
                <a href=".reply" data-toggle="collapse">reply</a>
            @endforeach
        </div>

        <form method="post" action="{{ route('reply.add') }}">
            @csrf
            <div class=" reply collapse">
                <div class="form-group">
                    <input type="text" name="comment" class="form-control"/>
                    <input type="hidden" name="product_id" value="{{ $product_id }}"/>
                    <input type="hidden" name="comment_id" value="{{ $comment->id }}"/>
                </div>
                <div class="form-group">
                    <input type="submit" class="btn btn-warning" value="comment"/>
                </div>
            </div>
        </form>

    </div>
@endforeach
16 Aug
10 months ago

Aqeel94321 started a new conversation How Add Font-awesome Icon As An Image In My Categories Table. Using HTML 5 Select Tag.

Hi! Any way to use path of font awesome icons to use as an input of mt category image.? and i want all font-awesome icon show in my option tag. any idea?

30 Jul
10 months ago

Aqeel94321 left a reply on Dynamically Change 'input' Selector Types

Once Again Thanks @Sergiu17 !, That you noticed about setting attribute chain.

Aqeel94321 left a reply on Dynamically Change 'input' Selector Types

@Sergiu17 Thanks for your reply..really appreciating. :)

Aqeel94321 started a new conversation Dynamically Change 'input' Selector Types

How to change type of input of desire selection but page not reload and type of input changed? using Jquery or JavaScript in laravel.

Any idea? i just want to got an idea about this concept. Please suggest best answer.. :)

18 Jul
11 months ago

Aqeel94321 left a reply on Node Must Exist...error.. Kolney/nestedset In Laravel

@bobbybouwmann thanks for your reply.here is my code.

create method

 public function create(Request $input)
    {
        $data = $input->only('parent_id');

        $categories = $this->getCategoryOptions();

        return view('categories.create', compact('data', 'categories'));
    }

store method

  public function store(PostCategoryRequest $input)
    {
        $category = Category::create($input->all());

        return redirect()
            ->route('categories.show', [ $category->getKey() ])
            ->with('success', 'Category successfully created!');
    }

Show method

   public function show($id)
    {
        $category = Category::findOrFail($id);
        $categories = $this->getCategoryOptions($category);
        return view('categories.show', compact('category','categories'));
    }

Aqeel94321 started a new conversation Node Must Exist...error.. Kolney/nestedset In Laravel

Im using kalnoy/nestedset package for nesting categories but there's an error when creating a new child category it through an error node must exist.

how can handle this error?

Aqeel94321 left a reply on Node Must Exists Error In Nestedset

Hi @ciby i have same problem that you face now how solve this problem.?

Aqeel94321 started a new conversation Select2 Jquery Lib In Laravel 5.6

How add select2 jquery library for replacement of select box in laravel using webpack? any idea?

17 Jul
11 months ago

Aqeel94321 left a reply on Laravel Post And Tags Relatinship Problem

you don't have to mention pivot table and foreign keys in model because you follow laravel convention and laravel automatic handle this...

and use in blade file as

<div class="form-group form-check">
                          <input type="checkbox" class="form-check-input"  value="{{$fields->id}}" name="tags[{{$tag->id}}]">
                          <label class="form-check-label" for="exampleCheck1">{{$tag->name}}</label>
</div>

and in your blog controller

public function store(Request $request)
    {
        $arr = array();
        foreach ($request->tags as $key=>$value)
            array_push($arr,$key);
     
        $types->tags()->sync($arr);
        return redirect(url('/post'));
    }

this may b helpfull to you...:)

Aqeel94321 left a reply on Schema Table In Laravel Add Column Dynamically

@Cronix Thanks .... your reply solve my problem thanks Again..

Aqeel94321 left a reply on Schema Table In Laravel Add Column Dynamically

@Cronix Thanks for reply. your logic is good but ,this fine if type have different field. if i'm create product of type that have one same field like color etc. then it through a error that field already have.. but i want to compare field then this don't give that error. and i don't understand how to compare...

16 Jul
11 months ago

Aqeel94321 started a new conversation Schema Table In Laravel Add Column Dynamically

I have a dynamic add product form in which we access field and category related to product type .But when page load first time the extra field add to product table but when second time its if clause not run fully and check only first value. if find then return view. but i want to all field that related to type.

public function create($id) { $type = Type::find($id); $category = Category::all(); foreach ($type->field as $key => $value) { if (Schema::hasColumn('products', "{$value->fieldname}")) {

        return view('products.create', compact('type', 'category'));
    } else
        {if (!Schema::hasColumn('products', "{$value->fieldname}")) {

foreach ($type->field as $key => $value) { Schema::table('products', function ($table) use ($value) { $table->string("{$value->fieldname}")->nullable()-> after('category_id'); }); }

                return view('products.create', compact('type', 'category'));
            }

        }

    }
}