icelander

icelander

Member Since 1 Year Ago

Experience Points
2,960
Total
Experience

2,040 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-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
2,960 XP
Jan
10
1 week ago
Activity icon

Started a new Conversation Unable To Find Sdk

I installed android studio and genymotion. I tried using the path I used for my android studio but I get the above errors in my genymotion; this folder does not contain any android SDK. This is the path;

...AppData/local/Android/SDK. 

Please help out.

Jan
07
2 weeks ago
Activity icon

Started a new Conversation Error Of Undefined Property

When I die and dump my output just to see how it looks like, I have this

array:1 [▼
  0 => Cart {#345 ▼
    +items: array:1 [▼
      9 => array:3 [▶]
    ]
    +totalQty: 1
    +totalPrice: 1100
  }
]

This now is my blade file

foreach(  $orders as $order)
                  <div class="panel panel-default">
                     <div class="panel-body">
                        <ul class="list-group">
                           @foreach($order->cart->items as $item)
                           <li class="list-group-item"> <span
class="badge">  </span>
                               | {{$item['price']}} Units

                           </li>
                           @endforeach
                        </ul>
                     </div>
                     <div class="panel-footer"><strong>Total Price:N
</strong></div>
                  </div>
                  @endforeach 

This is the error I get when I load the blade file on my browser

ErrorException (E_ERROR)
Undefined property: App\Cart::$cart (View:
C:\xampp\htdocs\pharmacy\resources\views\profiles\orders.blade.php)
Previous exceptions
Undefined property: App\Cart::$cart (0)

what could be the solution

Activity icon

Replied to Displaying An Output

@sergiu17 I get a new error,

undefined offset
Activity icon

Replied to Displaying An Output

@sergiu17 How do I unserialize it with a typical example please.

Activity icon

Started a new Conversation Displaying An Output

Hi. This is the output I get when I do die and dump

array:1 [▼
  0 => array:1 [▼
    "cart" => "O:8:"App\Cart":3:{s:5:"items";N;s:8:"totalQty";i:0;s:10:"totalPrice";i:0;}"
  ]
]

And this is my controller

public function orders(){

        $orders= Auth::user()->transactions;
        $or=$orders->map->only(['cart'])->all();


dd($or);

        return view('profiles.orders',['orders'=>$or]);
    }

please how do I properly render it on my blade file to show the various items on the cart. Thanks.

Jan
05
2 weeks ago
Activity icon

Replied to How To Solve This Error; Invalid Argument Supplied For For Each()

@nakov this is my cart model

<?php

namespace App;



class Cart
{
    public $items= null;
    public $totalQty=0;
    public $totalPrice = 0;

    public function __construct($oldCart){

        if ($oldCart) {
            $this->items = $oldCart->items;
            $this->totalQty = $oldCart->totalQty;
            $this->totalPrice = $oldCart->totalPrice;           # code...
        }
    }

    public function add($item, $id){
        $storedItem = ['qty'=>0, 'price'=>$item->price, 'item'=>$item];
        if ($this->items) {
            if (array_key_exists($id, $this->items)) {
                $storedItem = $this->items[$id];
            }
        }
        $storedItem['qty']++;
        $storedItem['price'] =$item->price* $storedItem['qty'];
        $this->items[$id] = $storedItem;
        $this->totalQty++;
        $this->totalPrice += $item->price;    
    }
}

and i guess it reverts to this default value each time i store it on d database and want to retrieve it

   "id" => 1
        "email" => "[email protected]"
        "transaction_id" => "XPcJeNpK5L8BLIVzl6fkFrrNT"
        "pharmacy" => ""
        "status" => "success"
        "amount" => "190000"
        "paid_at" => "2019-12-25T17:03:11.000Z"
        "user_id" => "1"
        "cart" => Cart {#343 ▼
          +items: null
          +totalQty: 0
          +totalPrice: 0
        }
        "created_at" => "2019-12-25 16:05:04"
        "updated_at" => "2019-12-25 16:05:04"
      ]
      #original: array:11 [▼

how can i load the original cart arrray stored on my database

Activity icon

Replied to How To Solve This Error; Invalid Argument Supplied For For Each()

@nakov the original array in d above dd($orders) has the values of the cart am interested in. Is there a way I can access that?

Activity icon

Replied to How To Solve This Error; Invalid Argument Supplied For For Each()

@mstrauss this is the output of dd($order)

Collection {#355 ▼
  #items: array:1 [▼
    0 => Transaction {#351 ▼
      #table: "transaction"
      #fillable: array:7 [▶]
      #connection: "mysql"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:11 [▼
        "id" => 1
        "email" => "[email protected]"
        "transaction_id" => "XPcJeNpK5L8BLIVzl6fkFrrNT"
        "pharmacy" => ""
        "status" => "success"
        "amount" => "190000"
        "paid_at" => "2019-12-25T17:03:11.000Z"
        "user_id" => "1"
        "cart" => Cart {#343 ▼
          +items: null
          +totalQty: 0
          +totalPrice: 0
        }
        "created_at" => "2019-12-25 16:05:04"
        "updated_at" => "2019-12-25 16:05:04"
      ]
      #original: array:11 [▼
        "id" => 1
        "email" => "[email protected]"
        "transaction_id" => "XPcJeNpK5L8BLIVzl6fkFrrNT"
        "pharmacy" => ""
        "status" => "success"
        "amount" => "190000"
        "paid_at" => "2019-12-25T17:03:11.000Z"
        "user_id" => "1"
        "cart" => "O:8:"App\Cart":3:{s:5:"items";N;s:8:"totalQty";i:0;s:10:"totalPrice";i:0;}"
        "created_at" => "2019-12-25 16:05:04"
        "updated_at" => "2019-12-25 16:05:04"
      ]
Activity icon

Replied to How To Solve This Error; Invalid Argument Supplied For For Each()

@nakov the cart isn't an empty array. It has an array of values

Activity icon

Replied to How To Solve This Error; Invalid Argument Supplied For For Each()

@tray2 , how can I display a collection on my blade file? The result of die and dump is a collection.

Activity icon

Replied to How To Solve This Error; Invalid Argument Supplied For For Each()

thats the result i get from dd($orders);

Collection {#355 ▼
  #items: array:1 [▼
    0 => Transaction {#351 ▼
      #table: "transaction"
      #fillable: array:7 [▶]
      #connection: "mysql"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:11 [▶]
      #original: array:11 [▶]
      #changes: []
      #casts: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: []
      #touches: []
      +timestamps: true
      #hidden: []
      #visible: []
      #guarded: array:1 [▶]
    }
  ]
}

it returns something

Activity icon

Started a new Conversation How To Solve This Error; Invalid Argument Supplied For For Each()

I usually get the above errors in my page. This is how my blade file looks like;

@foreach ($orders as $order)
<ul>
@foreach($order->cart->items as $item)
<li> {{$item['price']}} </li>
@endforeach</ul> 
@endforeach 

This is the controller

Public function orders(){
$orders= Auth::user()->transactions;
$orders->transform (function ($order, $key){
$order->cart=unserialize($order->cart);
return $order;
});
return view('profiles. orders',['orders'=>$orders]);

Please help.

Jan
02
2 weeks ago
Activity icon

Replied to Creating Default Object From Empty Value

@nakov , this is the corrected version of the controller

 public function redirectToGateway(Request $request)
    {
        //$pharm=$request->get('pharmacy');
        
         $oldCart = Session::get('cart');
          $cart = new Cart($oldCart);
     
        
        


          $transhistory= Transaction::find($request->get('user_id'));
           $transhistory->pharmacy=$request->get('pharmacy');

           $transhistory->email=$request->get('email');
          
           $transhistory->amount=$request->get('amount');
           $transhistory->cart=serialize($cart);
           $transhistory->save();

this is the error

Creating default object from empty value
Activity icon

Started a new Conversation Creating Default Object From Empty Value

I want to save some values in my transaction table. I stored the value of the pharmacy in a session and now am trying to save it. This is my controller;

Public function redirectToGateway(Request $request)
{
$old cart= Session:: get('cart');
$cart=new Cart($oldCart);
session ()->put ('user_id,$request->get('user_id));
session ()->put ('pharmacy',$request->get('pharmacy'));
$id= Session:: get('user_id');
$pharmacy= Session:: get('pharmacy');
$transhistory=Transaction:: find($id);
$transhistory->pharmacy=$pharmacy;
$transhistory->email=$request->get('email');
$transhistory->amount=$request->get('amount');
$transhistory->cart=serialize($cart);
$transhistory->save();
Jan
01
3 weeks ago
Activity icon

Replied to Sessions

Yea the session in the first controller returned a valid result. But when I did the session()->get('pharmacy'); in the second controller, I got null. Am confused, because, I have set the session to store the value in the first controller but when I call back that session in d second controller it returns null

Activity icon

Started a new Conversation Sessions

hi. this is my controller where i have set my sessions

 public function redirectToGateway(Request $request)
    {
        //$pharm=$request->get('pharmacy');
        
        
        session()->put('pharmacy',$request->get('pharmacy'));
         session()->put('user_id',$request->get('user_id'));

       
       


     

        
        return Paystack::getAuthorizationUrl()->redirectNow();
    }

when i do

$phs=session()->get('pharmacy');
dd($phs);

i get the correct value of the session stored. now the problem is when i try to retrieve the value of the stored session in the previous controller, into this new controller, i get an error signifying that it can not get the value of the session. i want to retrieve the session value and store it in this other controller as so;

  public function handleGatewayCallback(Request $request)
    {
 $phs=session()->get('pharmacy');
   $user_id=session()->get('user_id');


    Transaction::create([
        'transaction_id' =>$paymentDetails['data']['reference'],
        'email' =>$paymentDetails['data']['customer']['email'],
        'cart'=>serialize($cart),
        'status' =>$paymentDetails['data']['status'],
        'amount' =>$paymentDetails['data']['amount'],
        'paid_at' =>$paymentDetails['data']['paid_at'],
        'user_id'=>$user_id,
        'pharmacy'=>$phs,

        

    ]);

but i get errors

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'pharmacy' cannot be null (SQL: insert into `transaction` (`transaction_id`, `email`, `cart`, `status`, `amount`, `paid_at`, `pharmacy`, `updated_at`, `created_at`) values (R0yFI85sJ5JqVYetzk2dEdu3X, [email protected], O:8:"App\Cart":3:{s:5:"items";N;s:8:"totalQty";i:0;s:10:"totalPrice";i:0;}, success, 110000, 2020-01-01T13:29:21.000Z, , 2020-01-01 12:27:50, 2020-01-01 12:27:50))
Dec
29
3 weeks ago
Activity icon

Replied to Error In Getting The Session Value

these are the form values sent

_token: QO9O0B9jvYB3h1dCMAMXaH5jLBRfDTl2RDyuuTLZ
pharmacy: Joez Pharmacy, Zik Avenue, Awka, Nigeria
email: [email protected]
pharmacy:   
amount: 60000
metadata: {"pharmacy":null}
reference: brRQNgBs4DkrwPN7Nrn0361Ca
key: sk_test_b0ebcd79a3df3c4bffc741c237c6e478c22ea8b9

meaning that the appropraite selection of pharmacy in the select drop down was captured, as seen in the first pharmacy value: joez pharmacy, but the other empty pharmacy variable means that the session was not captured.

Activity icon

Replied to Error In Getting The Session Value

the option field is created and appended to the select option with the help of javascript

 let option = document.createElement("option");
              option.text=pharmname;
              option.value=pharmname;
              document.getElementById('inputGroupSelect01').appendChild(option);

i have removed the multiple sightings of the csrf token.

Activity icon

Replied to Error In Getting The Session Value

this is the form with the csrf token. it submits to the above route, pay

  <form action="{{ route('pay') }}" method="post" class="creditly-card-form agileinfo_form">
                                 @csrf
                              <section class="creditly-wrapper wrapper">
                                 <div class="information-wrapper">
                                    <div class="first-row form-group">
                                        <div class="input-group mb-3">
                                             <div class="input-group-prepend">
                                                <label class="input-group-text" for="inputGroupSelect01">Pharmacies</label>
                                             </div>
                                            
                                             <select class="custom-select" id="inputGroupSelect01" name="pharmacy">
                                             
                                                
                                             </select>
                                             <input type="hidden" name="email" value="{{Auth::user()->email}}"> {{-- required --}}
                              <input type="hidden" name="pharmacy" value=" {{session('pharmacy')}} ">
                              <input type="hidden" name="amount" value="{{$totalPrice*100}}"> {{-- required in kobo --}}
                  
                              <input type="hidden" name="metadata" value="{{ json_encode(['pharmacy' => session('pharmacy')]) }}" > {{-- For other necessary things you want to add to your payload. it is optional though --}}
                              <input type="hidden" name="reference" value="{{ Paystack::genTranxRef() }}"> {{-- required --}}
                              <input type="hidden" name="key" value="{{ config('paystack.secretKey') }}"> {{-- required --}}
                              {{ csrf_field() }} {{-- works only when using laravel 5.1, 5.2 --}}

                               <input type="hidden" name="_token" value="{{ csrf_token() }}"> {{-- employ this in place of csrf_field only in laravel 5.0 --}}

                                          </div>
                                              <div class="card_number_grids">
                                              <div class="card_number_grid_left">
                                             
                                          </div>
                                          
                                          <div class="clear"> </div>
                                       </div>
                                       
                                       
                                    </div>
                                    
                                 </div>
                              </section>
                               <div class="checkout-right-basket">
                              <button class="submit check_out" type="submit" value="Make Payment">Make a Payment </button> 
                           </div>
                           </form>

when i click on the make payment button, i want to get the value i selected from the select drop down list, but this is the error i get

null

obviously, it is not getting any value from the select option. however,what i want it to do is to grab the value i selected from the drop down so i can see it displayed on the page when i hit the make payment button.

Activity icon

Started a new Conversation Error In Getting The Session Value

this is my select option displaying the list of nearby pharmacies

 <form action="{{ route('pay') }}" method="post" class="creditly-card-form agileinfo_form">
                              <section class="creditly-wrapper wrapper">
                                 <div class="information-wrapper">
                                    <div class="first-row form-group">
                                        <div class="input-group mb-3">
                                             <div class="input-group-prepend">
                                                <label class="input-group-text" for="inputGroupSelect01">Pharmacies</label>
                                             </div>
                                            
                                             <select class="custom-select" id="inputGroupSelect01" name="pharmacy">
                                             
                                                
            </select>

this is my controller

public function redirectToGateway(Request $request)
    {
        $pharm= $request->get('pharmacy');
     

        dd($pharm);
        return Paystack::getAuthorizationUrl()->redirectNow();
    }

this is what it looks like when i click inspect elements on the browser

<select class="custom-select" id="inputGroupSelect01" name="pharmacy">
                                             
                                                
                                                
     <option value="Magduke Pharmaceutical Ltd., Ziks Ave, Awka, Nigeria">Magduke Pharmaceutical Ltd., Ziks Ave, Awka, Nigeria</option>
<option value="Radopin Supermarket Awka, Nnamdi Azikiwe Avenue, Awka, Nigeria">Radopin Supermarket Awka, Nnamdi Azikiwe Avenue, Awka, Nigeria</option>
<option value="Joez Pharmacy, Zik Avenue, Awka, Nigeria">Joez Pharmacy, Zik Avenue, Awka, Nigeria</option></select>

where am i getting it wrong please.

Dec
27
3 weeks ago
Activity icon

Replied to Errors

this is my javascript function that makes a list of nearby pharmacies display on the select field

 let option = document.createElement("option");
              option.text=pharmname;
              option.value=pharmname;
              document.getElementById('inputGroupSelect01').appendChild(option);
           

this is the select input field

 <div class="input-group-prepend">
                                                <label class="input-group-text" for="inputGroupSelect01">Pharmacies</label>
                                             </div>
                                            
                                             <select class="custom-select" id="inputGroupSelect01" name="pharmacy">
                                             <option value=" "></option>
                                              <option value=""></option>
                                                
                                                
                                             </select>

how do i make it possible that for any pharmacy clicked from the select drop down, its corresponding value is grabbed and put inside a session. thanks

Activity icon

Replied to Errors

the page loads and shows

null
Activity icon

Replied to Errors

i get this error

Undefined variable: request
Activity icon

Replied to Errors

it is not picking or getting the result of the pharmacy selected

"pharmacy" => null

i got the value of the pharmacy, put it inside my select option

<div class="first-row form-group">
                                        <div class="input-group mb-3">
                                             <div class="input-group-prepend">
                                                <label class="input-group-text" for="inputGroupSelect01">Pharmacies</label>
                                             </div>
                                            
                                             <select class="custom-select" id="inputGroupSelect01" name="pharmacy">
                                             
                                                
                                                
                                             </select>

so that whatever that is selected is picked and stored in a session, as i did in my controller

 public function checks(Request $request){
        $pharmacy=pharmacy::whereBetween('pharmacy_lat',[$lat-5.1,$lat+5.1])->whereBetween('pharmacy_lng',[$lng-5.1,$lng+5.1])->get();
        session()->put('pharmacy',$request->input('pharmacy'));
        return view('shoppingCart.checkout',['pharmacy'=>$pharmacy]);
    }

and hence tried to invoke it back on the checkout page but it seems its not working.

Activity icon

Started a new Conversation Errors

this is my code

<input type="hidden" name="metadata" value="{{ json_encode($array = ['pharmacy' => {{session('pharmacy')}},]) }}" >

but i get these errors in my laravel page

syntax error, unexpected '{' (View: C:\xampp\htdocs\pharmacy\resources\views\shoppingCart\checkout.blade.php)

please how do i solve this problem. i just want to put my session value inside the hidden input field.

Dec
24
4 weeks ago
Activity icon

Replied to Grabbing The Value Of A Select Field

How do I then use it or invoke it in another page

Activity icon

Replied to Grabbing The Value Of A Select Field

Please how do I put that pharmacy value in a session so I can use it somewhere else

Activity icon

Started a new Conversation Grabbing The Value Of A Select Field

hi. this is my select input field below

 <label class="input-group-text" for="inputGroupSelect01">Pharmacies</label>
                                             </div>
                                            
                                             <select class="custom-select" id="inputGroupSelect01">
                                             
                                                
                                                
                                             </select>

and this is the javascript function that put the values there;

 let option = document.createElement("option");
              option.text=pharmname;
              option.value=pharmname;
              document.getElementById('inputGroupSelect01').appendChild(option);

now the problem is, how do i grab the correct option selected from the select input field, which in this case, is a list of nearby pharmacies, and use it in my controller. thanks

Dec
23
4 weeks ago
Activity icon

Started a new Conversation Not Working Dropdown

hi. my drop down is not working. it does not drop down.

<li class="nav-item dropdown active">
                     <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                     Categories
                     </a>
                     <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                        <a class="nav-link" href="product.html">General health Care</a>
                        <a class="nav-link " href="product.html">Beauty Care</a>
                        <a class="nav-link " href="product.html">Medicals</a>
                        <a class="nav-link " href="product.html">Mother & Baby</a>
                        <a class="nav-link " href="product.html">Personal Care</a>
                        <a class="nav-link " href="product.html">Health & Wellness</a>

                     </div>
                  </li>
Dec
21
1 month ago
Activity icon

Started a new Conversation Store And Display An Excel File In My Laravel App

Please how can I possibly store an excel file with the several columns corresponding to my already created columns in my database, so that I can output them

Dec
20
1 month ago
Activity icon

Started a new Conversation How To Add The Value Of A Variable To My Select Input Field

this is my select input field

<form action="payment.html" method="post" class="creditly-card-form agileinfo_form">
                              <section class="creditly-wrapper wrapper">
                                 <div class="information-wrapper">
                                    <div class="first-row form-group">
                                        <div class="input-group mb-3">
                                             <div class="input-group-prepend">
                                                <label class="input-group-text" for="inputGroupSelect01">Pharmacies</label>
                                             </div>
                                            
                                             <select class="custom-select" id="inputGroupSelect01">
                                                <option selected="">Choose...</option>
                                                <option value="">  </option>
                                                
                                             </select>
                                          </div>

this is my javascript code

function searchPharmacy(lat,lng){
               $.post('http://127.0.0.1:8000/api/checkout',{lat:lat,lng:lng},function(match){
                  // console.log(match);
                  $.each(match, function(i,val){
                   var pharmlatval=val.pharmacy_lat;
                   
                    var pharmlngval=val.pharmacy_lng;
                    var pharmname=val.pharmacy_state;
                    var picn='https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png';
                PLatLng = new google.maps.LatLng(pharmlatval, pharmlngval);

                createMarker(PLatLng,picn,pharmname);
                 document.getElementById('inputGroupSelect01').value=pharmname;
                 console.log(pharmname);

                  });
               });
            }

i want to output the value of the variable pharmname on the select input form field. how do i go about it.

Dec
18
1 month ago
Activity icon

Started a new Conversation Auto Fill Of Text Box

I want to click a shop on my google maps and have that shop details automatically get filled up in a text box. Am using Laravel. Thanks

Dec
13
1 month ago
Activity icon

Replied to No Message

I just want to be redirected to another page on the click of the checkout button but am redirected to the page but with the error message that the page is expired. The page works with JavaScript and the JavaScript doesn't know its a post request, else, it will not show that error. Can JavaScript be this difficult?

Activity icon

Replied to No Message

@sinnbeck I have opened d dev tools and submitted the form but am lost. I don't see any requests.

Activity icon

Replied to No Message

@inspiredprynce I have written that code on my script tag and I added the csrf token as a hidden form field as shown below

<input type="hidden" name="_token " value="unfndjejdbxhdjdjjbdhdh5474">

But its still giving me the same error.

Activity icon

Replied to No Message

Its still giving the same error message. This form is tied to a js file and along the JavaScript codes I found this;

name: 'staplesbmincart'
Parent: (typeof document !='undefined')? document.body: null,
action:'/checkout',
target:''
....

In the action line of code above I changed it to the checkout route but its still giving me the same error of the page has expired due to inactivity.

Activity icon

Replied to No Message

I have done that, but the new error message is

The page has expired due to inactivity
Activity icon

Replied to No Message

<form action="{{route('checkout')}}" method ="post" class="last">
@csrf 
<button class"top_toys_cart" type="submit" value="">
</form>
Activity icon

Replied to No Message

No. Its from clicking a checkout button

Activity icon

Started a new Conversation No Message

Hi. I usually get this error message whenever I hit the endpoint /checkout;

MethodNotAllowedHttpException
No message

This is how my route looks like

Route::get('/checkout', '[email protected]')->name('checkout');

And my Pages controller

Public function index(){
return view('shoppingCart.checkout');
Dec
07
1 month ago
Activity icon

Started a new Conversation How To Load Jfif Pictures

Please how do I show a .jfif picture file extension on my Laravel app. Whenever I use the .jfif file, it doesn't show.

Nov
27
1 month ago
Activity icon

Started a new Conversation Code Placement

hi guys, please how do i make my code look exactly like this bootstrap code that has 6 items on its display; 3 items on the left and 3 on the right, as shown below

<div class="why-choose-agile pt-5" id="services">
        <div class="container pt-xl-5 pt-lg-3">
            <div class="w3ls-titles text-center mb-5">
                <h3 class="title">Our Best Services</h3>
                <span>
                    <i class="fas fa-user-md"></i>
                </span>
                <p class="mt-2">Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
            </div>
            <div class="row why-choose-agile-grids-top">
                <div class="col-lg-4 agileits-w3layouts-grid">
                    <div class="row wthree_agile_us">
                        <div class="col-3 agile-why-text p-0 text-right">
                            <div class="wthree_features_grid">
                                <i class="fas fa-user-md"></i>
                            </div>
                        </div>
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3">General health care</h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                    </div>
                    <div class="row wthree_agile_us my-5">
                        <div class="col-3 agile-why-text p-0 text-right">
                            <div class="wthree_features_grid">
                                <i class="fas fa-syringe"></i>
                            </div>
                        </div>
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3">Dental services</h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                    </div>
                    <div class="row wthree_agile_us">
                        <div class="col-3 agile-why-text p-0 text-right">
                            <div class="wthree_features_grid">
                                <i class="fab fa-medrt"></i>
                            </div>
                        </div>
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3">Medical Treatment</h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4 agileits-w3layouts-grid img text-center">
                    <img src="images/b3.png" alt=" " class="img-fluid" />
                </div>
                <div class="col-lg-4 agileits-w3layouts-grid">
                    <div class="row wthree_agile_us">
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3">Cardiac Clinic</h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                        <div class="col-3 agile-why-text p-0">
                            <div class="wthree_features_grid">
                                <i class="fas fa-medkit"></i>
                            </div>
                        </div>
                    </div>
                    <div class="row wthree_agile_us my-5">
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3">Orthopedics</h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                        <div class="col-3 agile-why-text p-0">
                            <div class="wthree_features_grid">
                                <i class="fas fa-wheelchair"></i>
                            </div>
                        </div>
                    </div>
                    <div class="row wthree_agile_us">
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3">Laboratory</h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                        <div class="col-3 agile-why-text p-0">
                            <div class="wthree_features_grid">
                                <i class="fas fa-hospital"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

i tried outputting it like this, as it fetches the items from the database, but the output on the browser turned out so ugly

  @foreach($medications as $med)
  <div class="why-choose-agile pt-5" id="services">
        <div class="container pt-xl-5 pt-lg-3">
            <div class="w3ls-titles text-center mb-5">
                <h3 class="title">Our Best Services</h3>
                <span>
                    <i class="fas fa-user-md"></i>
                </span>
                <p class="mt-2">Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
            </div>
            <div class="row why-choose-agile-grids-top">
                <div class="col-lg-4 agileits-w3layouts-grid">
                    <div class="row wthree_agile_us">
                        <div class="col-3 agile-why-text p-0 text-right">
                            <div class="wthree_features_grid">
                                <i class="fas fa-user-md"></i>
                            </div>
                        </div>
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3">{{$med->medication}} </h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                    </div>
                   
                    
                </div>
                <div class="col-lg-4 agileits-w3layouts-grid img text-center">
                    <img src="{{asset('user/images/b3.png')}}" alt=" " class="img-fluid" />
                </div>
                <div class="col-lg-4 agileits-w3layouts-grid">
                   
                   
                    
                </div>
            </div>
        </div>
    </div>@endforeach
Activity icon

Started a new Conversation Undefined Constant

this is the error i get in my code "Use of undefined constant medications - assumed 'medications' (this will throw an Error in a future version of PHP)". This is my controller;

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;
use App\Medication;


use Illuminate\Support\Facades\Auth;
class PagesController extends Controller
{
    public function first(){
        
        return view('welcome');
    }


     public function showlogin(){
        $medications= Medication::all();
        return view('welcome',compact(medications));
    }

then this is how its rendered on my blade file

 @foreach($medications as $med)
                        <div class="col-9 agile-why-text-2">
                            <h4 class="text-dark font-weight-bold mb-3"> {{$med->medication}} </h4>
                            <p>Lorem ipsum magna, vehicula ut porta ete.</p>
                        </div>
                        @endforeach
Nov
25
1 month ago
Activity icon

Started a new Conversation Google Maps Api Error

below is my javascript code;

<script>
        var map= new google.maps.Map(document.getElementById('map-canvas'),{
          center:{
            lat: 27.72,
            lng:85.36
          },
          zoom:15
        });

        var marker = new google.maps.Marker({
          position: {
            lat: 27.72,
            lng: 85.36
          },
          map: map,
          draggable: true
        });

        var  searchBox = new google.maps.places.SearchBox(document.getElementById('searchmap'));
        google.maps.event.addListener(searchBox, 'places_changed',function(){
          var places = searchBox.getPlaces();
          var bounds= new google.maps.latlngBounds();
          var i, place;

          for (i=0; place=places[i];i++){
            bounds.extend(place.geometry.location);
            marker.setPosition(place.geometry.location); //set marker position new
          }
          map.fitBounds(bounds);
          map.setZoom(15);
        });
        google.maps.event.addListener(marker, 'position_changed', function(){
          var lat= marker.getPosition().lat();
          var lng= marker.getPosition().lng();
          $('#lat').val(lat);
          $('#lng').val(lng);


        });
      </script>

but each time i open up my console on my browswer, i see a red underline in this part of the code

 var bounds= new google.maps.latlngBounds();

as this error prevents the new typed location from loading up.

Activity icon

Replied to Errors

but i discovered that each time i open the console this code is highlighted in red. and it prevents me from getting the new location in my map

 var bounds= new google.maps.latlngBounds();
Activity icon

Replied to Errors

thanks guys. its working 100%

Activity icon

Started a new Conversation Errors

hi. am implementing google maps api on my laravel app, but i experienced some errors such as; my marker is not draggable even when i have made it draggable from my code and also when i open my console on the web browswer, the dollar sign i used in my code is highlighted in red. this is the code below;

        var map= new google.maps.Map(document.getElementById('map-canvas'),{
          center:{
            lat: 27.72,
            lng:85.36
          },
          zoom:15
        });

        var marker = new google.maps.Marker({
          position: {
            lat: 27.72,
            lng: 85.36
          },
          map: map,
          draggable: true
        });

        var  searchBox = new google.maps.places.SearchBox(document.getElementById('searchmap'));
        google.maps.event.addListener(searchBox, 'places_changed',function(){
          var places = searchBox.getPlaces();
          var bounds= new googl.maps.latlngBounds();
          var i, place;

          for (i=0; place=places[i];i++){
            bounds.extend(place.geometry.location);
            marker.setPosition(place.geometry.location); //set marker position new
          }
          map.fitBounds(bounds);
          map.setZoom(15);
        });
        google.maps.event.addListener(marker, 'position_changed', function(){
          var lat= marker.getPosition().lat();
          var lng= marker.getPosition().lng();
          $('#lat').val(lat);
          $('#lng').val(lng);


        });
      </script>
Nov
15
2 months ago
Activity icon

Started a new Conversation How To Get The Corel Draw Raw File From An Installed Corel Draw On My System

Hi. Please I have Corel draw in my system but I want to install it on another system. Is it possible for me to get the raw file from the programs folder in the C drive or is there another means I can use to extract the raw file.

Activity icon

Replied to Undefined Class Constant 'users'

After I used the author middleware it redirected me to the Laravel default login page where I logged in and the first name I required was displayed. But however, I want it to login directly from the login page I already provided. The controller for my login is;

This is my controller to display my own login page

Nov
13
2 months ago
Activity icon

Replied to Undefined Class Constant 'users'

Am using a mobile phone to type sir. After I used the author middleware it redirected me to the Laravel default login page where I logged in and the first name I required was displayed. But however, I want it to login directly from the login page I already provided. The controller for my login is;

Public function login(Request $request){ $this->validate ($request,[ 'email' =>'required|email|max:255', 'password' =>'required|max:255', ]); return redirect()-> route('seconds');

This is my controller to display my own login page

Public function showLogin(){ return view('welcome');