Aqeel94321

Aqeel94321

Member Since 1 Year Ago

Lahore

Web developer at COMSATS university Islamabad,Lahore Campus

Experience Points 1,700
Experience Level 1

3,300 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 2
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.

13 Sep
2 days ago

Aqeel94321 started a new conversation Middleware In Laravel

Hi i want to know how we redirect a middleware to grouped route middleware

For example:

Route::group([
'domain' => '{subdomain}.localhost',
'middleware'=> 'checksubdomainanddatabase'
], function () {

            
        });

in middleware

$domain = Domain::where('domain_name', Route::current()->parameters['subdomain'])->first();
            if ($domain){
               return ;  // groupedroute ??
            }

how can we redirect to Route::group(); can we assign name to Route::group() if yes then how?

Thanks in Advance..

11 Sep
4 days ago

Aqeel94321 left a reply on Multi-tenancy Using Laravel App

@sti3bas Hyn documentation is not properly i read previously.

Thanks BTW. Your reply means to me.

Aqeel94321 left a reply on Multi-tenancy Using Laravel App

@sti3bas Can you have "hyn 5.4" i only required simple project integration??

You say it worked really good but i face much difficulties to integration with this package. Can you send demo for that instead of this boiler plate that you mention above.

Aqeel94321 left a reply on Multi-tenancy Using Laravel App

@sti3bas Thanks for your reply.

Every package have own limitations. Can you suggest best package for multi-tenancy and have demo project for that. i read documention of https://tenancy.dev/docs/hyn/5.4 but i can't understand how it work..

but my requirement is multi-tenancy with multiple databases because every client have confidential data.

Aqeel94321 started a new conversation Multi-tenancy Using Laravel App

Hi! Everyone. I want to make multi-tenant app using laravel but i don't want to use any multi-tenancy laravel package to achieve multi-tenancy.

Can you help me how to achieve multi-tenancy in laravel 6.0 i have achieved some task like( dynamic db created and migrate the migration related to tenant and redirect admin to its domain.) but in which i have some issue related to only admin redirect its domain..

1: if i create new user then it will not rediect to its domain that are admin domain. 2: how Sub-Domain Routing work? can i achieve multi-tenancy using sub-domain routing.

07 Sep
1 week ago

Aqeel94321 left a reply on Multi Tenancy Using Multiple Databases

@hamelraj Thanks for your reply How can we get server name? and i'm little bit confuse of your reply.

Aqeel94321 started a new conversation Database Exist Or Not ?

Hi! How can we check if database is exist or not in Laravel 6.0 ??

your help really appreciated.

30 Aug
2 weeks ago

Aqeel94321 left a reply on Call Model Function Inside Model

Create private function of secondFunction.

public static function FirstFunction(){

$this->secondFunction(); }

private function secondFunction(){

}

Aqeel94321 started a new conversation Multi Tenancy Using Multiple Databases

I have 3(three) migration: 1: users 2: websites 3: databases

users migration: users have name, email , phone , and passwords

websites migration: websites have websitename , domain , http_status and user_id,

databases migration: databases have dbname , dbuser, dbpassword , dbconnection , website_id

user hasOne website. and websites hasOne database.

how can i achieve multi-tenancy using these schema i want to use middleware for redirect to domain that are associated with this user and only access to database that are associated with this website?

usi

21 Aug
3 weeks ago

Aqeel94321 left a reply on Domain Mapping Using Laravel

@andresayej How can i achieve multi-tenancy in my app if i make custom algorithm for that task please give suggestion

Aqeel94321 left a reply on Domain Mapping Using Laravel

Thanks buddy. Yes i want multi-tenancy in my laravel web app.. Thank for your reply.

20 Aug
3 weeks ago

Aqeel94321 started a new conversation Domain Mapping Using Laravel

Hi! Every one, I have an scenario for my website which i want to build.

For example,

I have website which domain is 'abcd.com' and i want all my client use same domain with concatenate client website domain which client select and new domain something like this 'abcd.com/xyz.com' what can i do please give suggestions and if anyone have tutorial please share with me..

Your help really appreciated. Thanks In Advance.

20 Apr
4 months ago

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.. in these array some value have in databsae and some value are new to add in database. 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
8 months ago

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
10 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
10 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
10 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);
        }
//    dd($arr); // [0 => "Griffin Daugherty"1 => "Erica Solomon"2 => "Rogan Morton"3 => "Sigourney Rodgers"

        foreach ($fields->extra_option()as $extraoptions)
        {
            $extraoptions->extraoption= $arr;
            $extraoptions->save();
        }

Thanks in Advance :)

23 Oct
10 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
10 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
11 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
11 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
11 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 ? If this is best approach then how to define relation between two model having different database? briefly explain with related work if any.. Thanks

18 Aug
1 year 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
1 year 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
1 year 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
1 year 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
1 year ago

Aqeel94321 left a reply on Laravel Post And Tags Relatinship Problem

Don't need 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="{{$tag->id}}" name="tags[{{$tag->id}}]">
                          <label class="form-check-label" >{{$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);
     
        $post->tags()->sync($arr);
        return redirect(url('/post'));
    }

this may b helpfull to you...:)