mykelcodex

mykelcodex

Web Developer at Twingle Inc

Member Since 1 Year Ago

Lagos

Experience Points
5,830
Total
Experience

4,170 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
38
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 2
5,830 XP
Oct
19
16 hours ago
Activity icon

Replied to Adding Up Price Per Week With Transactions

@nakov, it does and it worked..thank you

Activity icon

Replied to Adding Up Price Per Week With Transactions

Hi, @nakov , i have this in my controller


 public function cashout($id){

$transactions = Transaction::where('user_id',$id)->orderBy('created_at','desc')->get()->groupBy(function($date) {
      return Carbon::parse($date->created_at)->format('W');
             })->map(function ($row) {
             return $row->toArray() + ['total' => $row->sum('product_price')]
                    ;
               });

         return view('cashout')->with(['transactions'=>$transactions]);
    }

and i have this in my view


@foreach($transactions as $week =>$transactions)

{{ count($transactions) }} {{ count($transactions) <= '1' ? 'Transaction' : 'Transactions' }} was made

@foreach($transactions as $trans)

<th scope="row">
       {{ $trans['product_name'] }}
    ......
 </th>

@endforeach
@endforeach

Oct
18
1 day ago
Activity icon

Replied to Adding Up Price Per Week With Transactions

@nakov , i have an issue with the total in my view, how do i fix this. It show an extra field?

Activity icon

Replied to Adding Up Price Per Week With Transactions

thanks @nakov , i sincerely appreciate. :)

Activity icon

Replied to Adding Up Price Per Week With Transactions

@nakov , It returned this, and i can't loop through

array:5 [▼
  42 => array:3 [▼
    0 => array:15 [▶]
    1 => array:15 [▼
      "id" => 1
      "user_id" => 3
      "product_id" => 1
      "transactionId" => "136537621"
      "orderId" => "#00000002"
      "product_name" => "Lonart"
      "product_description" => "Artemether 80mg, Lumefantrine 480mg"
      "product_price" => "5"
      "buyer_name" => "Oke Michael"
      "status" => "success"
      "created_at" => "2019-10-16 10:22:15"
      "updated_at" => "2019-10-16 10:22:15"
    ]
    "total" => 10
  ]
  41 => array:2 [▶]
  40 => array:5 [▶]
  39 => array:2 [▶]
  34 => array:2 [▶]
]

My blade

@foreach($transactions as $week =>$transactions)

{{ $transactions->count() }} {{ $transactions->count() <= '1' ? 'Transaction' : 'Transactions' }} was made

@foreach($transactions as $trans)

<th scope="row">
       {{ $trans->product_name }}
 </th>

@endforeach
@endforeach

but i kept getting an error

Activity icon

Replied to Adding Up Price Per Week With Transactions

@nakov , it worked. thank you

Activity icon

Started a new Conversation Adding Up Price Per Week With Transactions

I have this


$weekly_price = Transaction::where('user_id',$id)->orderBy('created_at','desc')->get()->groupBy(function($date) {
              return Carbon::parse($date->created_at)->format('W');
              })->map(function ($row) {
                  return $row->sum('product_price');
             });



$weekly_transaction = Transaction::where('user_id',$id)->orderBy('created_at','desc')->get()->groupBy(function($date) {
            return Carbon::parse($date->created_at)->format('W');
            });

The first code returns only the total price for weekly transactions, while the second code returns only weekly transactions in details.

How do i get to return weekly transactions alongside with the total price?

Oct
11
1 week ago
Activity icon

Replied to Display Weekly Transactions Alongside The Sum Of Product Price Column

hey @douglasakula , i would appreciate if you can show me how?

Activity icon

Started a new Conversation Display Weekly Transactions Alongside The Sum Of Product Price Column

Hey guys,

i have this code in my controller which displays the total amount of product price(weekly)


$weekly = Transaction::where('user_id',$id)->orderBy('created_at','desc')->get()->groupBy(function($date) {
             return Carbon::parse($date->created_at)->format('W');
             })->map(function ($row) {
                 return $row->sum('product_price');
             });

i also have this which displays the transactions(weekly)


$weekly = Transaction::where('user_id',$id)->orderBy('created_at','desc')->get()->groupBy(function($date) {
             return Carbon::parse($date->created_at)->format('W');
             });

i want to display the weekly transactions alongside the total of the product price(weekly). Please how do i do this?

Oct
10
1 week ago
Activity icon

Started a new Conversation Sum Column

Hey guys,

i have this code in my controller which displays the total amount of product price(weekly)


$weekly = Transaction::where('user_id',$id)->orderBy('created_at','desc')->get()->groupBy(function($date) {
             return Carbon::parse($date->created_at)->format('W');
             })->map(function ($row) {
                 return $row->sum('product_price');
             });

i also have this which displays the transactions(weekly)


$weekly = Transaction::where('user_id',$id)->orderBy('created_at','desc')->get()->groupBy(function($date) {
             return Carbon::parse($date->created_at)->format('W');
             });

i want to display the weekly transactions alongside the total of the product price(weekly). Please how do i do this?

Oct
03
2 weeks ago
Activity icon

Replied to Pass More Than One Value To Input Field

@geowrge

array:10 [▼
  "_token" => "qNhxlgaM7Z4Q6sEn0tMqcFXJepHOsl1jVgxmv8Cy"
  "amount" => "10,300"
  "payment_method" => "both"
  "description" => "Product from Abek Store"
  "country" => "NG"
  "currency" => "NGN"
  "email" => "[email protected]"
  "firstname" => "Careclick"
  "metadata" => "[{"metaname":"color","metavalue":"blue"},{"metaname":"size","metavalue":"big"}]"
  "phonenumber" => "08168696515"
]

i am trying to achieve something like this as seen above in my metadata

i have a button for payment, how can i iterate through the Cart::content and have it in my metadata


<td data-column="Card Payment">
                  @php
                  $array = array(array('metaname' => 'color', 'metavalue' => 'blue'),
                                  array('metaname' => 'size', 'metavalue' => 'big'));
                  @endphp
                  <form method="POST" action="{{ route('pay') }}" id="paymentForm">
                      {{ csrf_field() }}
                      <input type="hidden" name="amount" value="{{ Cart::total() }}" />
                      <input type="hidden" name="payment_method"value= "both" /> 
                      <input type="hidden" name="description" value="Product from {{ $item->model->user->name}} Store" />
                      <input type="hidden" name="country" value="NG"/>
                      <input type="hidden" name="currency" value="NGN" />
                      <input type="hidden" name="email" value="{{ Auth::user()->email }}" /> 
                      <input type="hidden" name="firstname" value="{{ Auth::user()->name }}" />
                      <input type="text" name="metadata" value="{{ json_encode($array) }}" >
                      <input type="hidden" name="phonenumber" value="{{ Auth::user()->phone }}" /> 
                     <input class="text-sm w-full bg-green-500 text-white px-2 py-1 rounded shadow" type="submit" value="Pay with card"  />
                  </form>
              </td>

Activity icon

Replied to Pass More Than One Value To Input Field

sorry @ashbakernz , please check again

Activity icon

Started a new Conversation Pass More Than One Value To Input Field

I already have this in my blade which returns the total name of products in cart


@php
     foreach (Cart::content() as $item){
    $array = $item->name;
         dump($array);  
    }
 @endphp

Please how can i pass it to the value of my input field?

<input type="hidden" name="metadata" value="{{ $array }}" >

Activity icon

Replied to Foreach Is Only Returning The First Value

@resin @skauk I want to pass the details of the product as a metadata


<?php
                foreach (Cart::content() as $item){
                   $array = [
                     'product_name'=> $item->name
                    
                    ];
                }
  ?>
<h3>Buy Movie Tickets N500.00</h3>
<form method="POST" action="{{ route('pay') }}" id="paymentForm">
    {{ csrf_field() }}
    <input type="hidden" name="amount" value="500" /> <!-- Replace the value with your transaction amount -->
    <input type="hidden" name="payment_method" value="both" /> <!-- Can be card, account, both -->
    <input type="hidden" name="description" value="Beats by Dre. 2017" /> <!-- Replace the value with your transaction description -->
    <input type="hidden" name="country" value="NG" /> <!-- Replace the value with your transaction country -->
    <input type="hidden" name="currency" value="NGN" /> <!-- Replace the value with your transaction currency -->
    <input type="hidden" name="email" value="[email protected]" /> <!-- Replace the value with your customer email -->
    <input type="hidden" name="firstname" value="Oluwole" /> <!-- Replace the value with your customer firstname -->
    <input type="hidden" name="lastname" value="Adebiyi" /> <!-- Replace the value with your customer lastname -->
    <input type="hidden" name="metadata" value="{{ json_encode($array) }}" > <!-- Meta data that might be needed to be passed to the Rave Payment Gateway -->
    <input type="hidden" name="phonenumber" value="090929992892" /> <!-- Replace the value with your customer phonenumber -->
    {{-- <input type="hidden" name="paymentplan" value="362" /> <!-- Ucomment and Replace the value with the payment plan id --> --}}
    {{-- <input type="hidden" name="ref" value="MY_NAME_5uwh2a2a7f270ac98" /> <!-- Ucomment and  Replace the value with your transaction reference. It must be unique per transaction. You can delete this line if you want one to be generated for you. --> --}}
    {{-- <input type="hidden" name="logo" value="https://pbs.twimg.com/profile_images/915859962554929153/jnVxGxVj.jpg" /> <!-- Replace the value with your logo url (Optional, present in .env)--> --}}
    {{-- <input type="hidden" name="title" value="Flamez Co" /> <!-- Replace the value with your transaction title (Optional, present in .env) --> --}}
    <input type="submit" value="Buy"  />
</form>

But i keep getting this after

dump(request()->all());


array:10 [▼
  "_token" => "qNhxlgaM7Z4Q6sEn0tMqcFXJepHOsl1jVgxmv8Cy"
  "amount" => "5,800"
  "payment_method" => "both"
  "description" => "Product from Abek Store"
  "country" => "NG"
  "currency" => "NGN"
  "email" => "[email protected]"
  "firstname" => "Careclick"
  "metadata" => "{"product_name":"Paracetamol"}"
  "phonenumber" => "08168696515"
]

Activity icon

Replied to Foreach Is Only Returning The First Value

ok @skauk,

After dump(Cart::content())

CartItem {#1185 ▼
  +rowId: "370d08585360f5c568b18d1f2e4ca1df"
  +id: 2
  +qty: "1"
  +name: "Paracetamol"
  +price: 4500.0
  +weight: 10.0
  +options: CartItemOptions {#1186 ▶}
  -associatedModel: "App\PProduct"
  -taxRate: 0
  -discountRate: 0
}
CartItem {#1187 ▼
  +rowId: "027c91341fd5cf4d2579b49c4b6a90da"
  +id: 1
  +qty: 1
  +name: "Lonart"
  +price: 1300.0
  +weight: 10.0
  +options: CartItemOptions {#1188 ▶}
  -associatedModel: "App\PProduct"
  -taxRate: 0
  -discountRate: 0
}

Now trying to do this in my blade


<div>
@php
    foreach (Cart::content() as $item){
      dd($item->toArray());
      // $array = array('user_id' => $item->model->user->id, 'product_id'=>$item->model->product->id);
         }
 @endphp
</div>

i get just the first value.

Activity icon

Replied to Foreach Is Only Returning The First Value

@skauk very true but iterating as well, i get the first value alone

Activity icon

Started a new Conversation Foreach Is Only Returning The First Value

I am currently building a store and i am using Crinsane package but i found out that after trying to iterate over the cart item, i only get the first item but after dd(Cart::content()) i get a collection of all the items in the cart.


public function test(){

        foreach(Cart::content() as $row) {
            dd($row);

    }
}

please how do i go about this?

Sep
27
3 weeks ago
Activity icon

Replied to Create A Table With Foreign Key

Hi @munazzil , thanks for your swift response. i just tried this but i am still getting the same response error

Activity icon

Started a new Conversation Create A Table With Foreign Key

Anytime i tried creating this table i get

PDOException::("SQLSTATE[HY000]: General error: 1005 Can't create table store.products (errno: 150 "Foreign key constraint is incorrectly formed")")

Products Table


Schema::create('products', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('category_id');
            $table->foreign('category_id')->references('id')->on('categories');
            $table->string('product_name');
            $table->string('product_image');
            $table->string('product_price');
            $table->string('brand');
            $table->string('product_description');
            $table->string('prescription_status')->nullable();
            $table->string('store_name');
            $table->timestamps();
        });

Category Name

Schema::create('categories', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('category_name');
            $table->timestamps();
        });

Sep
10
1 month ago
Activity icon

Replied to Edit And Update With The Eloquent ORM

you are calling the create method instead of the update method like this

 $user->client->update([
......
]);
Aug
31
1 month ago
Activity icon

Replied to Illegal String Offset 'customer'

You are right @snapey , Thank you.

Activity icon

Started a new Conversation Illegal String Offset 'customer'

I have this in my controller

public function transactions(){
        $subs = Rave::listSubscriptions();
        $sub = $subs->data->plansubscriptions;
        
        return view('transactions',compact('subs'));
    }

I am trying to display this in my blade view like this

      @foreach ($subs as $sub)
                <tr>
                   <td>{{ $loop->iteration }}</td>
                   <td class="font-size-sm">{{ $sub['customer']['customer_email'] }}</td>
        </tr>
         @endforeach

but i keep getting "Illegal string offset 'customer'"

public function transactions(){
        $subs = Rave::listSubscriptions();
        $sub = $subs->data->plansubscriptions;
        dd($sub)
        return view('transactions',compact('sub'));
    }
array:10 [▼
  0 => {#482 ▼
    +"id": 3840
    +"amount": 1000
    +"customer": {#483 ▼
      +"id": 67773583
      +"customer_email": "[email protected]"
    }
    +"plan": 3249
    +"status": "cancelled"
    +"date_created": "2019-08-29T03:37:12.000Z"
  }
  1 => {#484 ▼
    +"id": 3839
    +"amount": 1000
    +"customer": {#485 ▶}
    +"plan": 3249
    +"status": "active"
    +"date_created": "2019-08-29T03:30:36.000Z"
  }
  2 => {#486 ▶}
  3 => {#488 ▶}
  4 => {#490 ▶}
  5 => {#492 ▶}
  6 => {#494 ▶}
  7 => {#496 ▶}
  8 => {#498 ▶}
  9 => {#500 ▶}
]

Please, how can i resolve this?

Aug
09
2 months ago
Activity icon

Replied to Generating Uuid As Primary Key

Thanks @click , it worked. I'll read more on traits

Activity icon

Replied to Generating Uuid As Primary Key

Hey, @click ,

thanks, corrected it but i still get another error,

PHP Error: Class 'App/Traits/boot' not found in C:/xampp/htdocs/twingle/app/Traits/UsesUuid.php on line 11

Activity icon

Started a new Conversation Generating Uuid As Primary Key

Please i am having an issue generating a uuid as primary key in my user model. i always get field 'id' doesn't have a default value when creating a new user

User Model (App\User)


<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Traits\UsesUuid;

class User extends Authenticatable
{
    use Notifiable,UsesUuid;

    protected $keyType = 'string';

    public $incrementing = false;

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

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

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

which use a Trait

UseUuid(App\Traits)

<?php

namespace App\Traits;
use Ramsey\Uuid\Uuid;


trait UsesUuid
{
  public static function bootIdentifiesUsingUuids()
    {
        boot::creating(function ($model) {
            $model->setAttribute($model->getKeyName(), Uuid::uuid4());
        });
    }
}

User mIgration

    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });

Please any help will be deeply appreciated. thanks

Jul
30
2 months ago
Activity icon

Started a new Conversation Authentication In An SPA

Currently building an SPA with Laravel and VueJS, What Oauth2 would you suggest i use for authentication likewise for Social Auth?

Jul
13
3 months ago
Activity icon

Replied to Unknown Custom Element

Yes @maverickchan

-components -tabs -tab

-pages -profile

Activity icon

Replied to Unknown Custom Element

@nakov , it's something similar to this, https://codepen.io/tatimblin/pen/oWKdjR

Activity icon

Replied to Unknown Custom Element

Thanks for your response @nakov , tried your answer but the error still persist. Is there anything else I am not doing right?

Activity icon

Started a new Conversation Unknown Custom Element

I want to create a tab in vuejs but all i get is an error, Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

I have already import all needed components including the tab component but still get the error.

Any help will be appreciated

Profile Component


<template>
  <layout>
    <div class="mt-4 md:mt-10">
        <div class="mx-auto px-3 sm:px-6 xl:px-16">    
            <div class="flex flex-wrap justify-between">
                <div class="md:w-2/6 lg:w-1/5 w-full mb-6 lg:mb-0 lg:block md:order-last lg:order-none">
                    <div class="bg-white rounded shadow">   
                                </div>
                            </div>
                        </div>
                        <div>
                            <div class="text-center justify-center flex-col">
                                <div class="border-t border-b flex justify-center items-center">
                                    <p class="px-3 py-1 flex-col">
                                        <span class="font-bold text-sm">543</span> 
                                        <span class="text-gray-500 text-xs">Posts</span>
                                    </p>
                                    <p class="px-3 border-l py-1 flex-col">
                                        <span class="font-bold text-sm">436</span> 
                                        <span class="text-gray-500 text-xs">Following</span>
                                    </p>
                                </div>
                            </div>
                        </div>   
                    </div>
                    <div class="p-4 bg-white shadow mt-4">
                        <div class="flex items-center">
                          <i data-feather="map-pin" class="text-gray-600 w-4 h-4"></i>
                          <span class="text-sm ml-3 font-semibold text-gray-800">Lagos, Nigeria</span>
                        </div>
                                                <div class="flex items-center mt-2">
                                                    <i data-feather="calendar" class="text-gray-600 w-4 h-4"></i>   
                                                    <span class="text-sm ml-3 font-semibold text-gray-800">Joined, January 2018</span>
                        </div>
                        <div class="flex items-center mt-2">
                                                    <i data-feather="link" class="text-gray-600 w-4 h-4"></i>   
                                                    <span class="text-sm ml-3 font-semibold text-gray-800 hover:underline"><a href="#">https://twingle.io</a></span>
                        </div>
                       <div class="flex items-center mt-2">
                                                    <i data-feather="globe" class="text-gray-600 w-4 h-4"></i>  
                                                    <span class="text-sm ml-3 font-semibold text-gray-800 hover:underline"><a href="#">https://omike.me</a></span>
                        </div>
                    </div>
                    <div class="p-4 bg-white shadow mt-4">
                        <div>
                            <p class="font-bold">My Skills</p>
                        </div>
                        <div class="mt-3">
                            <ul class="inline">
                                <li class="inline mr-2">Javascript</li>&middot;
                                <li class="inline mr-2">PHP</li>&middot;
                                <li class="inline mr-2">Laravel</li>&middot;
                                <li class="inline mr-2">NodeJS</li>&middot;
                                <li class="inline">VueJS</li>
                            </ul>
                        </div>
                    </div> 
                </div>
                <div class="w-full md:w-3/7 lg:w-1/2">
                    <tabs>
                                            <tab name="Services" :selected="true">
                                                <h1>What we do</h1>
                                            </tab>
                                            <tab name="Pricing">
                                                <h1>How much we do it for</h1>
                                            </tab>
                                            <tab name="About Us">
                                                <h1>Why we do it</h1>
                                            </tab>
                                        </tabs>
                </div>
                <div class="hidden lg:block md:w-2/6 lg:w-1/4">
                    <Info/>
                </div>
            </div>  
        </div>
    </div>        
    </layout>  
</template>
<script>

import Info from '@/Shared/Info'
import Layout from '@/Shared/Layout'
import UserFeed from '@/Components/User/UserFeed'
import Tabs from '@/Components/Tabs'

export default {
    components:{
        Info,
            UserFeed,
        Layout,
        Tabs,
    },
}
</script>

Tabs Component


<template>
    <div>
        <div class="bg-white shadow rounded px-4 mb-6">
           <ul class="list-reset flex pro-tab">
               <li class="pro-tab-active py-2">Posts</li>
               <li class="ml-6 py-2">Achievements</li>
               <li class="ml-6 py-2 hidden sm:block">Activities</li>
           </ul>
        </div>
        <div class="tab-details">
            <slot></slot>
        </div>
    </div>
</template>

<script>
import Tab from '@/components/Tab'

export default {

    component:{Tab},

    mounted(){
        console.log(this.$children);
    }


}
</script>

<style>

</style>

Tab Component


    <template>
    <div>
        <slot></slot>
    </div>
</template>

<script>
export default {

}
</script>

<style>

</style>


Jul
06
3 months ago
Activity icon

Started a new Conversation Building SPA

Please what are some pitfall i should look out for when building a spa, from the auth, rendering, routes, etc

Or probably recommend some useful packages for me.

I am using Laravel, VueJS and InertiaJS.

Thank you

Jun
02
4 months ago
Activity icon

Replied to Is It Possible To Add Class To My Rendered HTML After Using Laravel Markdown

Done @snapey, its actually taking me to a 404 page on mobile

Thanks

Activity icon

Replied to Is It Possible To Add Class To My Rendered HTML After Using Laravel Markdown

Its taking me to the 404 page @snapey , maybe because I am using the forum account

Activity icon

Replied to Is It Possible To Add Class To My Rendered HTML After Using Laravel Markdown

I'm sorry @snapey, i wish I can but I just have the forum account will upgrade soon.

Thanks

Jun
01
4 months ago
Activity icon

Replied to Is It Possible To Add Class To My Rendered HTML After Using Laravel Markdown

I just got blown, thanks @snapey, you are indeed a relief.

Activity icon

Started a new Conversation Is It Possible To Add Class To My Rendered HTML After Using Laravel Markdown

Hi guys, I am using Laravel Markdown in my project and i have been trying to add some space between paragraphs, all to no avail. Is there a way I can add a class in my markdown before rendering it so that I can style it?

May
07
5 months ago
Activity icon

Started a new Conversation Display Code Output

I have this Laravel Markdown installed in my website, I want to achieve something like this

Image

please how do I go about it?

Apr
16
6 months ago
Activity icon

Replied to Pluck Only Name From A Nested Array

Thanks for the help everyone, we were able to do this

public function getTransaction(){


       $trans = Paystack::getAllTransactions();
       foreach($trans as $tran){
        $transaction = collect(array_get($tran,('metadata.product_name')))->pluck('name')->unique()->toArray();
        dd($transaction);        
        }
        return view('product.transaction')->with('trans',$trans);
    }

so i got this

array:1 [▼
  0 => "Book details"
]

Now the question is, how do i pass it to my view?

Apr
15
6 months ago
Activity icon

Replied to Pluck Only Name From A Nested Array

thank you @mvd and @tykus , i tried both solution but all i get is an empty field, what i was expecting is the name of products ordered for that transaction.

Any further help will be sincerely appreciated.

Thank you

Activity icon

Started a new Conversation Pluck Only Name From A Nested Array

Please how do i pluck only name from the product_name array, so that i can display the names of item the user purchased...

array:3 [▼
  "status" => true
  "message" => "Verification successful"
  "data" => array:24 [▼
    "id" => 150482915
    "domain" => "test"
    "status" => "success"
    "reference" => "Xp5CSjuhQqGVffb9Wd5URHB25"
    "amount" => 77000
    "message" => null
    "gateway_response" => "Successful"
    "paid_at" => "2019-04-15T03:01:52.000Z"
    "created_at" => "2019-04-15T03:01:46.000Z"
    "channel" => "card"
    "currency" => "NGN"
    "ip_address" => "105.112.41.91"
    "metadata" => array:4 [▼
      "name" => "Oke Michael"
      "phone" => "08168696515"
      "address" => "5, Akindele Lane, Fardock Estate Ifako Ijaye, Lagos"
      "product_name" => array:2 [▼
        "bb4a6db4295d6be8bd12791ed5650087" => array:8 [▼
          "rowId" => "bb4a6db4295d6be8bd12791ed5650087"
          "id" => 14
          "name" => "Book details"
          "qty" => "1"
          "price" => 30000
          "options" => []
          "tax" => 0
          "subtotal" => 30000
        ]
        "8b486433ba8a9e4089eafa927840a692" => array:8 [▼
          "rowId" => "8b486433ba8a9e4089eafa927840a692"
          "id" => 13
          "name" => "Oke Michael"
          "qty" => "1"
          "price" => 47000
          "options" => []
          "tax" => 0
          "subtotal" => 47000
        ]
      ]
    ]
    "log" => array:8 [▶]
    "fees" => 1155
    "fees_split" => null
    "authorization" => array:12 [▶]
    "customer" => array:8 [▶]
    "plan" => null
    "paidAt" => "2019-04-15T03:01:52.000Z"
    "createdAt" => "2019-04-15T03:01:46.000Z"
    "transaction_date" => "2019-04-15T03:01:46.000Z"
    "plan_object" => []
    "subaccount" => []
  ]
]

I tried this

{{ array_get($tran,'metadata.product_name.name') }}

but it didn't work

Apr
11
6 months ago
Activity icon

Started a new Conversation Creating Vue Component

What are the things to look out for when creating vue components?

Apr
04
6 months ago
Activity icon

Replied to Convert Blade Template To Vue Components

hi @yakagi ,

Thanks for your swift response, the errors are

  • v-bind directives require an attribute value
  • Parsing error - Unexpected token fill

Thank you

Activity icon

Started a new Conversation Convert Blade Template To Vue Components

I tried converting my blade template to a vue component but it just couldn't compile due to some error i can't figure out. Please what am i doing wrong? Here is my code...

        <div class="bg-header bg-grey-lightest py-8 tagged">
            <div class="container mx-auto px-4">
                <div class="flex flex-wrap items-center justify-center">
                    <div class="w-full featured-bg-title">
                        <p class="text-white font-bold text-center uppercase text-xl sm:text-3xl md:text-4xl">Meet world class developers</p>
                    </div>
                    <div class="sm:mt-10">
                        <div class="flex items-center">
                            <div>
                                <img src="images/oke.jpg" class="sm:w-32 md:w-32 w-24 border-2 border-white rounded-full" alt="">
                            </div> 
                            <div class="ml-3 text-white">
                                <p class="font-semibold sm:text-2xl md:text-2xl text-xl mt-2">Oke Michael</p>
                                <p class="sm:text-md md:text-md text-sm">Laravel Developer</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="container mx-auto px-4">
        <div class="flex flex-wrap">
            <div class="w-full mt-12 md:w-1/3 xl:w-1/4 sm:w-1/2 px-2 sm:mt-12">
                <div class="shadow hover:shadow-md bg-white p-4 rounded-lg">
                    <div class="text-center Inline">
                        <img src="http://localhost:8000/images/oke.jpg" class="z-100 w-16 h-16 rounded-full" alt="">    
                        <svg data-tippy-content="Oke is your friend" xmlns="http://www.w3.org/2000/svg" class="text-twingle-green fill-current absolute w-4 -ml-4 mt-10" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-1.25 16.518l-4.5-4.319 1.396-1.435 3.078 2.937 6.105-6.218 1.421 1.409-7.5 7.626z"/></svg>
                    </div>  
                    <div class="text-center mt-4">
                        <p class="text-2xl font-semibold">Oke Michael</p>
                        <p class="mt-1 text-twingle-green-dark">Laravel Developer</p>
                        <p class="mt-1 text-sm text-grey-dark">Lagos, Nigeria</p>    
                    </div> 
                    <div class="flex justify-center mt-6">
                        <div class="sm:hidden md:hidden lg:block">
                            <svg xmlns="http://www.w3.org/2000/svg" class="tooltip stroke-current text-twingle-green" data-tippy-content="Message" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mail"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>
                        </div>
                        <div class="md:ml-0 lg:ml-10 sm:ml-0 ml-10 sm:hidden md:hidden lg:block">
                            <svg xmlns="http://www.w3.org/2000/svg" data-tippy-content="Notification" class="stroke-current tooltip text-twingle-green" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bell"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>
                        </div>
                        <div class="md:ml-0 lg:ml-10 sm:ml-0 ml-10">
                            <svg xmlns="http://www.w3.org/2000/svg" class="stroke-current tooltip text-twingle-green" data-tippy-content="Follow" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user-plus"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="20" y1="8" x2="20" y2="14"></line><line x1="23" y1="11" x2="17" y2="11"></line></svg>
                        </div>    
                    </div>        
                </div>
            </div>
            <div class="w-full mt-10 md:w-1/3 xl:w-1/4 sm:w-1/2 px-2 sm:mt-12">
                <div class="shadow hover:shadow-md bg-white p-4 rounded-lg">
                    <div class="text-center">
                        <img src="http://localhost:8000/images/oke.jpg" class="z-100 w-16 h-16 rounded-full" alt="">    
                        <svg data-tippy-content="Oke is your friend" xmlns="http://www.w3.org/2000/svg" class="text-twingle-green fill-current absolute w-4 -ml-4 mt-10" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-1.25 16.518l-4.5-4.319 1.396-1.435 3.078 2.937 6.105-6.218 1.421 1.409-7.5 7.626z"/></svg>
                    </div>  
                    <div class="text-center mt-4">
                        <p class="text-2xl font-semibold">Oke Michael</p>
                        <p class="mt-1 text-twingle-green-dark">Laravel Developer</p>
                        <p class="mt-1 text-sm text-grey-dark">Lagos, Nigeria</p>    
                    </div> 
                    <div class="flex justify-center mt-6">
                        <div class="sm:hidden md:hidden lg:block">
                            <svg xmlns="http://www.w3.org/2000/svg" class="tooltip stroke-current text-twingle-green" data-tippy-content="Message" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mail"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>
                        </div>
                        <div class="md:ml-0 lg:ml-10 sm:ml-0 ml-10 sm:hidden md:hidden lg:block">
                            <svg xmlns="http://www.w3.org/2000/svg" data-tippy-content="Notification" class="stroke-current tooltip text-twingle-green" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bell"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>
                        </div>
                        <div class="md:ml-0 lg:ml-10 sm:ml-0 ml-10">
                            <svg xmlns="http://www.w3.org/2000/svg" data-tippy-content="Following" class="stroke-current tooltip text-twingle-green" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user-check"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><polyline points="17 11 19 13 23 9"></polyline></svg>
                        </div>    
                    </div>        
                </div>
            </div>

</div>
Feb
09
8 months ago
Activity icon

Started a new Conversation Installing Tools For A New Project

I'm about to kick-start a new project, which I have carefully selected my tools. Below are the selected tools

  1. Laravel
  2. Vuejs
  3. Tailwindcss

Question : please, how best can I install these tools on my window machine?

Nov
09
11 months ago
Activity icon

Replied to How To Using Mysqli Num Rows In Laravel

//get your collection in your controller

$products = Product::all();

return view('products')->with('products', $products);

//then in your view

$products->count();

Aug
15
1 year ago
Activity icon

Started a new Conversation Show File Progress Bar

Currently building a web app that allows user to upload videos, now i have a form that post all user details and video using laravel, now i want to keep track of the file upload using a progress bar, in my finding....i discover vue.js can handle this.

But the problem is, i don't know how to go about this.

Any help will be deeply appreciated.

Thank you

Activity icon

Started a new Conversation Show Progress When Uploading Video Alongside With A Form

Currently building a web app that allows user to upload videos, now i have a form that post all user details and video using laravel, now i want to keep track of the file upload using a progress bar, in my finding....i discover vue.js can handle this.

But the problem is, i don't know how to go about this.

Any help will be deeply appreciated.

Thank you

Aug
12
1 year ago