tomasosho

CEO at TAP ventures & Edar Tech

Member Since 2 Years Ago

Abuja

Experience Points
15,050
Total
Experience

4,950 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
4
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

  • Community Pillar

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

Level 4
15,050 XP
Apr
17
12 hours ago
Activity icon

Replied to I Want To Decrease Order Product Quantity From Available Product Quantity When Updating Status As Invoice.

is this running?

//product Thilini
        if ($request->input('Status') == 'Invoice') {
            for ($p = 0; $p < count($products); $p++) {
                $product = product::find($products[$p]);
                if(($product->Qty>0)&&(( $product->Qty - $quantities[$p])>=0)){
                    $product->Qty = $product->Qty - $quantities[$p];
                    $product->save();
                }else{
                   // dd("error");               
                   redirect()->back()->with(["error"=> $product->Name.
                   " is not having enough  Quantity availble. only have  ". $product->Qty." Quantity."]);
                }
                
            }
Activity icon

Replied to Npm Run Dev (or Production) Stops At Setup With No Errors

try npm install might work or npm update

Activity icon

Replied to Need Shared Hosting Provider

you can go with bluehost, they are okay. I currently use them for several projects

Activity icon

Replied to Customize 404 Responses

Gotoapp/exceptions/handler.php

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

public function render($request, Throwable $exception)
    {
	
if($exception instanceof NotFoundHttpException)
        {
            return response()->view('error404page', [], 404);
        }

        return parent::render($request, $exception);

}

This will handle all your notfound queries

Activity icon

Replied to How To Change Fields From File Type To Text Type?

wrap your store parameters in a create array.

Apr
15
2 days ago
Activity icon

Replied to Problem Sending Email In Laravel

MAIL_MAILER=smtp
MAIL_HOST=host_from_email_setting
MAIL_PORT=465
MAIL_USERNAME=email_address
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=ssl
[email protected]com
MAIL_FROM_NAME="${APP_NAME}"
Activity icon

Replied to Problem Sending Email In Laravel

check your email configuration in .env file make sure it is correct

Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

public function handlePaystackPostCallBack()
    {
        // get transaction reference returned by Paystack
        $transactionRef = request()->input('reference');

        //verify the transaction is valid
        $transaction = Payment::hasValidTransaction($transactionRef);

        if ($transaction) {

            // create subscription for logged in user
                auth()->user()
                ->newSubscription('default', $transaction->data->plan)
                ->create($transaction->data->id);

                Subscription::updateOrCreate(
                    ['user_id' =>  auth()->user()->id],
                    ['package' => $transaction->data->plan]
                );

            return redirect()->route('vendor-profile.show', [auth()->user()->slug]);
        }

        throw PaymentFailure::incompleteTransaction($transaction);
    }

line 60

                auth()->user()
                ->newSubscription('default', $transaction->data->plan)
                ->create($transaction->data->id);
Apr
14
3 days ago
Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

from error log

[2021-04-14 21:49:52] local.ERROR: Object of class stdClass could not be converted to string {"userId":83,"exception":"[object] (Error(code: 0): Object of class stdClass could not be converted to string at /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Connection.php:582)
[stacktrace]
#0 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Connection.php(582): PDOStatement->bindValue(1, Object(stdClass), 2)
#1 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Connection.php(487): Illuminate\Database\Connection->bindValues(Object(PDOStatement), Array)
#2 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}('update `users` ...', Array)
#3 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('update `users` ...', Array, Object(Closure))
#4 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Connection.php(496): Illuminate\Database\Connection->run('update `users` ...', Array, Object(Closure))
#5 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Connection.php(429): Illuminate\Database\Connection->affectingStatement('update `users` ...', Array)
#6 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2870): Illuminate\Database\Connection->update('update `users` ...', Array)
#7 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(801): Illuminate\Database\Query\Builder->update(Array)
#8 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(808): Illuminate\Database\Eloquent\Builder->update(Array)
#9 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(723): Illuminate\Database\Eloquent\Model->performUpdate(Object(Illuminate\Database\Eloquent\Builder))
#10 /home4/afiaprim/afiaprime/vendor/digikraaft/laravel-paystack-subscription/src/SubscriptionBuilder.php(95): Illuminate\Database\Eloquent\Model->save()
#11 /home4/afiaprim/afiaprime/app/Http/Controllers/SubscriptionController.php(60): Digikraaft\PaystackSubscription\SubscriptionBuilder->create('1083789586', NULL, Array)
#12 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\SubscriptionController->handlePaystackPostCallBack()
#13 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('handlePaystackP...', Array)
#14 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Route.php(239): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\SubscriptionController), 'handlePaystackP...')
#15 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Route.php(196): Illuminate\Routing\Route->runController()
#16 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Router.php(685): Illuminate\Routing\Route->run()
#17 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#18 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#19 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Auth\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#24 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#25 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Session\Store), Object(Closure))
#28 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Router.php(687): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#35 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#36 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Router.php(628): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#37 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Routing/Router.php(617): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#38 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#39 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#40 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#47 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /home4/afiaprim/afiaprime/vendor/fruitcake/laravel-cors/src/HandleCors.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 /home4/afiaprim/afiaprime/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#51 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#52 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#53 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#54 /home4/afiaprim/afiaprime/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(109): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#55 /home4/afiaprim/public_html/index.php(57): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#56 {main}
"} 
Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

Share 


Expand vendor frames
57
vendor/laravel/framework/src/Illuminate/Database/Connection.php
PDOStatement
:582
56
Illuminate\Database\Connection
:582
55
Illuminate\Database\Connection
:487
54
Illuminate\Database\Connection
:664
53
Illuminate\Database\Connection
:631
52
Illuminate\Database\Connection
:496
51
Illuminate\Database\Connection
:429

5 vendor frames…
45
app/Http/Controllers/SubscriptionController.php
App\Http\Controllers\SubscriptionController
:59

43 vendor frames…
1
/home4/afiaprim/public_html/index.php
:57
PDOStatement::bindValue
vendor/laravel/framework/src/Illuminate/Database/Connection.php:582































    }

 

    /**

     * Bind values to their parameters in the given statement.

     *

     * @param  \PDOStatement  $statement

     * @param  array  $bindings

     * @return void

     */

    public function bindValues($statement, $bindings)

    {

        foreach ($bindings as $key => $value) {

            $statement->bindValue(

                is_string($key) ? $key : $key + 1,

                $value,

                is_int($value) ? PDO::PARAM_INT : PDO::PARAM_STR

            );

        }

    }

 

    /**

     * Prepare the query bindings for execution.

     *

     * @param  array  $bindings

     * @return array

     */

    public function prepareBindings(array $bindings)

    {

        $grammar = $this->getQueryGrammar();

 

        foreach ($bindings as $key => $value) {


            ````
Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

I just pasted the actual error below

Activity icon

Awarded Best Reply on Laravel On Shared Hosting

create a folder outside public_html and import and extract your files there excluding your public folder, then goto your public_html then import all public folder files there. In your public_html edit your index.php and include the folder your created there.

follow this link to learn more https://igniz87.medium.com/deploy-laravel-project-on-shared-hosting-cpanel-938b705ebe5a

Activity icon

Replied to Laravel On Shared Hosting

create a folder outside public_html and import and extract your files there excluding your public folder, then goto your public_html then import all public folder files there. In your public_html edit your index.php and include the folder your created there.

follow this link to learn more https://igniz87.medium.com/deploy-laravel-project-on-shared-hosting-cpanel-938b705ebe5a

Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

Error
Object of class stdClass could not be converted to string

/**
     * Bind values to their parameters in the given statement.
     *
     * @param  \PDOStatement  $statement
     * @param  array  $bindings
     * @return void
     */
    public function bindValues($statement, $bindings)
    {
        foreach ($bindings as $key => $value) {
            $statement->bindValue(
                is_string($key) ? $key : $key + 1,
                $value,
                is_int($value) ? PDO::PARAM_INT : PDO::PARAM_STR
            );
        }
    }

It highlighted the line below

is_int($value) ? PDO::PARAM_INT : PDO::PARAM_STR
Apr
13
4 days ago
Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

i'm not sure anymore, it was working a few days ago. i'm not sure what happened

Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

how do i convert the +"id": 108220000 to string?

Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

This is the link to the documentation i'm using

https://github.com/digikraaft/laravel-paystack-subscription
Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

let me share the full code

public function handlePaystackPostCallBack()
    {
        // get transaction reference returned by Paystack
        $transactionRef = request()->input('reference');

        //verify the transaction is valid
        $transaction = Payment::hasValidTransaction($transactionRef);

        if ($transaction) {

            // create subscription for logged in user
                auth()->user()
                ->newSubscription('default', $transaction->data->plan)
                ->create($transaction->data->id);

                Subscription::updateOrCreate(
                    ['user_id' =>  auth()->user()->id],
                    ['package' => $transaction->data->plan]
                );

            return redirect()->route('vendor-profile.show', [auth()->user()->slug]);
        }

        throw PaymentFailure::incompleteTransaction($transaction);
    }
Activity icon

Replied to Error Object Of Class StdClass Could Not Be Converted To String

newSubscription method is used to create the model's subscription, while the create method, which accepts a transaction ID, will begin the subscription as well as update your database with the customer ID and other relevant billing information.

Activity icon

Replied to Column Order For Indexing Polymorphic OneToMany Table

$this->index('foreign_id','id');
Activity icon

Started a new Conversation Error Object Of Class StdClass Could Not Be Converted To String

// get transaction reference returned by Paystack
        $transactionRef = request()->input('reference');

//verify the transaction is valid
$transaction = Payment::hasValidTransaction($transactionRef);

auth()->user()->newSubscription('default', $transaction->data->plan)->create($transaction->data->id);

when i dd($transaction)

{#1855 ▼
  +"status": true
  +"message": "Verification successful"
  +"data": {#1853 ▼
    +"id": 108220000
    +"domain": "test"
    +"status": "success"
    +"reference": "DK_SUB_1618340769_104451"
    +"amount": 950000
    +"message": null
    +"gateway_response": "Successful"
    +"paid_at": "2021-04-13T19:06:30.000Z"
    +"created_at": "2021-04-13T19:06:13.000Z"
    +"channel": "card"
    +"currency": "NGN"
    +"ip_address": "197.211.58.22"
    +"metadata": {#1840 ▶}
    +"log": {#1850 ▶}
    +"fees": 24250
    +"fees_split": null
    +"authorization": {#1847 ▶}
    +"customer": {#1856 ▶}
    +"plan": "PLN_nvpppppp"
    +"split": {#1857}
    +"order_id": null
    +"paidAt": "2021-04-13T19:06:30.000Z"
    +"createdAt": "2021-04-13T19:06:13.000Z"
    +"requested_amount": 950000
    +"pos_transaction_data": null
    +"transaction_date": "2021-04-13T19:06:13.000Z"
    +"plan_object": {#1858 ▶}
    +"subaccount": {#1859}
  }
}
Apr
09
1 week ago
Activity icon

Started a new Conversation How To Get Feeds From A GPS Tracker

How do i get feed on current location from a GPS tracker?

Mar
31
2 weeks ago
Activity icon

Awarded Best Reply on I Want To Get Products In A Sub Category

I missed selecting an id

public function show(SubCategory $id)
    {
            $data = Product::where('subcategory_id', $id->id)->with(['user'])->get();
            dd($data);
        }
Activity icon

Replied to I Want To Get Products In A Sub Category

I missed selecting an id

public function show(SubCategory $id)
    {
            $data = Product::where('subcategory_id', $id->id)->with(['user'])->get();
            dd($data);
        }
Activity icon

Started a new Conversation I Want To Get Products In A Sub Category

I have my products table with columns

categories_id, and subcategory_id

Controller

public function show(SubCategory $id)
    {
            $data = Product::where('subcategory_id', $id)->with(['user'])->get();
            dd($data);
        }

my dd is displaying empty array

Illuminate\Database\Eloquent\Collection {#1881 ▼
  #items: []
}

How do i display the products under that sub category?

Mar
14
1 month ago
Activity icon

Replied to ChartJS And Multi Bar Data Issue

paste your code, let's have a look

Activity icon

Awarded Best Reply on Add To Auth::user()->favorite

in your blade

<input type="file" class="form-control" name="favorite" accept="image/x-png,image/gif,image/jpeg">

in your controller where you have update

public function update(Request $request, $id)
    {
 if($request->hasFile('favorite')){
            // Get filename with the extension
            $filenameWithExt = $request->file('favorite')->getClientOriginalName();
            // Get just filename
            $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
            // Get just ext
            $extension = $request->file('favorite')->getClientOriginalExtension();
            // Filename to store
            $fileNameToStore = $filename.'_'.time().'.'.$extension;
            // Upload Image
            $path = $request->file('favorite')->storeAs('public/image', $fileNameToStore);
        }

        $user = User::find($id);
        $user->favorite = $fileNameToStore;
        $user->save();

        return back()->with('success', 'created successfully');
    }

This will help you upload your image for that user

Activity icon

Replied to Sum Of Product Prices In The Shopping Cart

if you're trying to get the total price, use this

Activity icon

Replied to Sum Of Product Prices In The Shopping Cart

in your table, i take it that final price is the price for an item yes or is it the total price?

Activity icon

Replied to Sum Of Product Prices In The Shopping Cart

paste your updated code here, let's see

Activity icon

Replied to Add To Auth::user()->favorite

in your blade

<input type="file" class="form-control" name="favorite" accept="image/x-png,image/gif,image/jpeg">

in your controller where you have update

public function update(Request $request, $id)
    {
 if($request->hasFile('favorite')){
            // Get filename with the extension
            $filenameWithExt = $request->file('favorite')->getClientOriginalName();
            // Get just filename
            $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
            // Get just ext
            $extension = $request->file('favorite')->getClientOriginalExtension();
            // Filename to store
            $fileNameToStore = $filename.'_'.time().'.'.$extension;
            // Upload Image
            $path = $request->file('favorite')->storeAs('public/image', $fileNameToStore);
        }

        $user = User::find($id);
        $user->favorite = $fileNameToStore;
        $user->save();

        return back()->with('success', 'created successfully');
    }

This will help you upload your image for that user

Activity icon

Replied to Sum Of Product Prices In The Shopping Cart

foreach ($this->carts as  $cart) {
                    $cart->coupon_id = $coupons[0]->id;
                    //this code should working
                    $cart->final_price = $total;
                    $cart->save();
                }
return number_format($cart->final_price);
Activity icon

Started a new Conversation Sort From $start To $end Getting Different Values Outside Range

I am getting different values out the range of $start and $end

$pricemax= $request->max_price;
            $pricemin= $request->min_price;
            $name= $request->name;

            $start = $pricemin;
            $end = $pricemax;
            $name= $name;

            //echo "both are selected";
            $data = DB::table('products')
            ->join('product_categories','product_categories.id', '=', 'products.categories_id')
            ->select('products.id', 'products.p_name', 'products.price', 'products.old_price', 'products.slug', 'product_categories.name',
            'products.image', 'products.categories_id')
            ->where('products.categories_id',$request->cat_id)
            ->where('products.price', ">=", $start)
            ->where('products.price', "<=", $end)
            ->get();
Mar
13
1 month ago
Activity icon

Replied to I've Been Getting 419 Page Expired On Hosting To Shared Hosting

i'm guessing it should be from the server, yes? because its getting csrf token and session on my local host

Activity icon

Replied to I've Been Getting 419 Page Expired On Hosting To Shared Hosting

This was what i got(Tabulated though)

_gid	Medium	
_ga Medium	
_gat	Medium	
__cfduid		✓		Lax	Medium
Activity icon

Replied to I've Been Getting 419 Page Expired On Hosting To Shared Hosting

My login form

<form class="lcontact-form" method="POST" action="{{ route('login') }}">
                @csrf
                <label for="username" style="color: #026bb3;">username or email</label>
                @error('username')
                    <span class="invalid-feedback" role="alert">
                        <i style="color:red;">{{ $message }}</i>
                    </span>
                @enderror
                <input type="text" name="username" class="form-control @error('username') is-invalid @enderror"  
                value="{{ old('username') }}" required autocomplete="username" autofocus>
                
                <label for="password" style="color: #026bb3;">password</label>
                @error('password')
                    <span class="invalid-feedback" role="alert">
                        <i style="color:red;">{{ $message }}</i>
                    </span>
                @enderror
                <input type="password" name="password" id="myInput" placeholder="Password" 
                class="form-control @error('password') is-invalid @enderror" required autocomplete="current-password">
                
                <div style="display: inline-block; margin-top: 10px; display: inline-block; margin-bottom: 10px; font-size: small; color: #026bb3; font-style: italic;">
                    <input type="checkbox" class="form-control" onclick="myFunction()"> Show Password
                </div>
                <script>
                    function myFunction() {
                        var x = document.getElementById("myInput");
                        if (x.type === "password") {
                            x.type = "text";
                        } else {
                            x.type = "password";
                        }
                    }
                </script>
                @error('password')
                    <span class="invalid-feedback" role="alert">
                        <strong>{{ $message }}</strong>
                    </span>
                @enderror
                @if (Route::has('password.request'))
                    <a href="{{ route('password.request') }}" class="forget-pwd">Forgot Password</a>
                @endif
                <button class="login-btn">Log in</button>
            </form>

It works in my local host

Activity icon

Started a new Conversation I've Been Getting 419 Page Expired On Hosting To Shared Hosting

My login and registration pages have the same issue, and yes i have @csrf and

    <meta name="csrf-token" content="{{ csrf_token() }}" />
</head>````
Mar
12
1 month ago
Activity icon

Replied to Loop From First To Last Value

lol... thanks

Activity icon

Replied to Loop From First To Last Value

I gave it a limit of five then i plucked data from the array manually

$attendance = DB::table('orders')
            ->select(DB::raw('DATE_FORMAT(created_at, "%Y-%b") as `month`'), DB::raw('SUM(grand_total) AS total'))
            ->groupBy('month')->orderBy('month','DESC')->limit(5)
            ->get();
        $amonth = $attendance->pluck('month');
        $atotal = $attendance->pluck('total');

        $monthlysales   = (new LarapexChart)->setType('area')
            ->setTitle('Total Monthly Sales')
            ->setXAxis([
                
                    $amonth[0], $amonth[1], $amonth[2], $amonth[3], $amonth[4]
                
            ])
            ->setDataset([
                [
                    'name'  =>  'Total Sales',
                    'data'  =>  $atotal
                ]
            ]);
Activity icon

Started a new Conversation Loop From First To Last Value

I want to loop through months for my setXAxis in my LarapexChart. Right now, my months are together on the xaxis instead of standing at intervals.

$attendance = DB::table('orders')
            ->select(DB::raw('DATE_FORMAT(created_at, "%Y-%b") as `month`'), DB::raw('SUM(grand_total) AS total'))
            ->groupBy('month')->latest()
            ->get();
        $amonth = $attendance->pluck('month');
        $atotal = $attendance->pluck('total');

        $monthlysales   = (new LarapexChart)->setType('area')
            ->setTitle('Total Monthly Monthly')
            ->setXAxis([
                [$amonth]
            ])
            ->setDataset([
                [
                    'name'  =>  'Total Sales',
                    'data'  =>  $atotal
                ]
            ]);
Mar
09
1 month ago
Activity icon

Started a new Conversation How To Fix Background Image In Html

This isn't working

background-image: url({{asset('image/$banner->image')}});

it is returning my image link as $banner->image.

Mar
06
1 month ago
Activity icon

Started a new Conversation Check If A User Already Purchased A Product

Controller

$order = Orders_model::find($id)->product->user;

Orders_model

public function product()
    {
        return $this->belongsTo(Product::class, 'product_id');
    }

public function user()
    {
        return $this->belongsTo(User::class, 'users_id');
    }
Mar
05
1 month ago
Activity icon

Started a new Conversation How To Count Unread Messages

my table

id
from
to
text
read

relationship

public function messages() {
        return $this->hasMany(Messaging::class, 'to', 'id');
    }


public function scopeLatestSendersMessages($query) 
    {
        return $query->orderBy('created_at', 'desc')
            ->get(['id', 'from', 'read', 'to', 'text',  'created_at'])
            ->unique('from');
    }

Controller

$messages = $user->messages()->latestSendersMessages();
$unreadMessages = $messages->where(['read' => '1'])->count();

How can i count Unread messages

Feb
27
1 month ago
Activity icon

Replied to Login And Redirect With Middleware

Yes, that was kind of what i did. I wasn't getting it initially.

Activity icon

Awarded Best Reply on Login And Redirect With Middleware

solved

if(Auth::user()->roles->first()->name == 'vendor'){
                if (Auth::user()->subscribedToPlan(['PLN_uqicl68u6pq9qyl', 'PLN_pmgc1t08ff3kwwr', 'PLN_pklwcpsl3s6odjf'], 'default')) {
                        return redirect()->route('vendor-profile.show', [auth()->user()->slug]);
                }
                else
                {
                    return redirect('package-list');
                }
            }