mykelcodex

mykelcodex

Member Since 1 Year Ago

Lagos

Web Developer at Twingle Inc

Experience Points 2,270
Experience Level 1

2,730 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 10
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

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

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

02 Jun
3 weeks ago

mykelcodex left a reply on 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

mykelcodex left a reply on 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

mykelcodex left a reply on 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

01 Jun
3 weeks ago

mykelcodex left a reply on 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.

mykelcodex 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?

07 May
1 month ago

mykelcodex 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?

26 Apr
1 month ago

mykelcodex left a reply on If Condition Check In Laravel

@cronix , solved the question... @van1310 you never did.

Thanks

16 Apr
2 months ago

mykelcodex left a reply on 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?

15 Apr
2 months ago

mykelcodex left a reply on 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

mykelcodex started a new conversation Pluck Only Name From A Nested Array

Please how do i pluck only name from the product_name array...

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

11 Apr
2 months ago

mykelcodex started a new conversation Creating Vue Component

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

04 Apr
2 months ago

mykelcodex left a reply on 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

this are the major errors

Thank you

mykelcodex 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 featured">
                        <div class="flex items-center">
                            <div>
                                <img src="{{ asset('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="bg-green-darker text-sm py-1 text-center rounded-full">Featured</p>
                                <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">
                        <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>
09 Feb
4 months ago

mykelcodex 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. Tailwaindcss

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

09 Nov
7 months ago

mykelcodex left a reply on 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();

15 Aug
10 months ago

mykelcodex 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

mykelcodex 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

12 Aug
10 months ago
11 Aug
10 months ago

mykelcodex left a reply on Looping Through Validation Messages And Flash It Using Toastr

@tykus , I tried this

<script >
var has_error = ({{ $errors->count() > 0 ? "true" : 
"false"}})

If(has_error){
 toastr.error(session::has('error'))
 }
</script>

But it didn't work

mykelcodex started a new conversation Looping Through Validation Messages And Flash It Using Toastr

Please how can i loop through validation errors and flash it using toastr?

06 Aug
10 months ago

mykelcodex started a new conversation How To Return Only Two Value In A Loop

The app is all about scoring video uploaded online, with adjudicators of different category.

I have in my controller

$watched = Upload::with('scoresheet')->get();

There is a reletionship between upload and scoresheet. In my controller, i am using "with" to grab the relationship eagerly, so that i can get who scored a video.

Now i am trying to loop through and displaying scored or unscored with the ifesle statement if they satisfy this condition

@foreach($watched as $scoredvideo )
@foreach($scoredvideo->scoresheet as $seen)
@if($seen->user_id == Auth::user()->id && $seen->upload_id == $video->id )
Scored
@else
Not Scored
@endif
@endforeach 
@endforeach

but, it kept on returning the message of the numbers of video that have been scored.

See below

New_Video

Here, three videos have been scored.

I tried using break, it only display the true value which is 'scored' and terminate the loop.

How can i solve this this?

Thanks .

mykelcodex left a reply on Break Loop When Condition Is True

@tykus , The app is all about scoring video uploaded online, with adjudicators of different category.

I have in my controller

$watched = Upload::with('scoresheet')->get();

There is a reletionship between upload and scoresheet. In my controller, i am using "with" to grab the relationship eagerly, so that i can get who scored a video.

Now i am trying to loop through and displaying scored or unscored with the ifesle statement if they satisfy this condition @foreach($watched as $scoredvideo ) @foreach($scoredvideo->scoresheet as $seen) @if($seen->user_id == Auth::user()->id && $seen->upload_id == $video->id ) Scored @else Not Scored @endif @endforeach @endforeach

but, it kept on returning the message of the numbers of video that have been scored.

See below

New_Video

I tried using break, it only display the true value which is 'scored' and terminate the loop.

How can i solve this this?

Thanks @tykus .

03 Aug
10 months ago

mykelcodex left a reply on Break Loop When Condition Is True

Please @tykus , can you expatiate.

Thanks

mykelcodex started a new conversation Break Loop When Condition Is True

I have this in my video.blade.php

@foreach($watched as $scoredvideo )
@foreach($scoredvideo->scoresheet as $seen)
@if($seen->user_id == Auth::user()->id && $seen->upload_id == $video->id )
Scored
@else
Not Scored
@endif
@endforeach
@endforeach

How do i break the loop if condition is true?

01 Aug
10 months ago

mykelcodex started a new conversation Problem With Looping(return One Value)

i am trying to display scored in my video page if the reference number of the video and the reference number in the scoresheet table are the same. But it keeps on looping through the video that the current user have already scored. Below is what my table looks like

<a href="https://ibb.co/mBQvtz"><img         
src="https://thumb.ibb.co/mBQvtz/mynewscore.jpg" alt="mynewscore" border="0"></a>

My video controller

 public function videos(){
    $id = auth()->user()->id;
    $watched = ScoreSheet::where('user_id', $id)->get();
return view('adjudicator.videos')->with('watched', $watched);
  }

My Video View @foreach($watched as $scoresheet)

  • {{$scoresheet->ref}} == {{$video->ref}} || {{$scoresheet->user_id}}
@foreach($watched as $scoresheet)
  • {{$scoresheet->ref}} == {{$video->ref}} || {{$scoresheet->user_id}}
@if(Auth::user()->ifScored() == $scoresheet->user_id && $scoresheet->ref == $video->ref) Scored @else Not Scored @endif @endforeach

My User Model

public function ifScored(){
    
    return $this->id;

}

The Output

<a href="https://ibb.co/jd0pLe"><img src="https://thumb.ibb.co/jd0pLe/scoreview.jpg"         
alt="scoreview" border="0"></a>
30 Jul
10 months ago

mykelcodex started a new conversation Return True If Current User Already Scored A Participant

I am working on a project which as to do with uploading and scoring a video online, i want to return true after a user score a video, so that the video will not be available to score for that particular user.

i am using the ManyToMany Relationship. Below is my database structure

https://ibb.co/bs2xm8

Scoresheet.php

public function upload() { return $this->belongsTo('App\Upload'); }

Upload.php

public function Scoresheet()
{
    return $this->belongsTo('App\ScoreSheet');
}
25 Jul
11 months ago

mykelcodex left a reply on Create A Pivot Table

Thanks @Cronix , it did work. But how do i add the primary key which is the id of the videos table and the users table to the pivot table.

24 Jul
11 months ago

mykelcodex left a reply on Create A Pivot Table

Thanks, @shez1983...how do i insert the primary key of the two tables into the pivot table since there isn't going to be a model for it.

mykelcodex started a new conversation Create A Pivot Table

I have two tables users and videos, Please do i create or generate a pivot table for them, I am using Laravel 5.6?

16 Jul
11 months ago

mykelcodex started a new conversation Add Values To Pivot Table

I am working on a project which require me to use a pivot table. This is what my pivot table looks like. ''public function up() { Schema::create('upload_user', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned()->index(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->integer('video_id')->unsigned()->index(); $table->foreign('video_id')->references('id')->on('uploads')->onDelete('cascade'); $table->integer('score_id')->unsigned()->index(); $table->foreign('score_id')->references('id')->on('score_sheets')->onDelete('cascade'); $table->timestamps(); }); }''

How can i insert the primary key of the other tables into my pivot table? Thanks

10 Jul
11 months ago
07 Jul
11 months ago

mykelcodex started a new conversation Create A Custom Auth

Please how can I create a custom Auth just like Auth::user()'' . The custom one will beAuth::scorescheet()``.

Thanks

06 Jul
11 months ago

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

@Cronix , the problem still persistent... I will appreciate if you can help.

Thanks

03 Jul
11 months ago

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

Please @Snapey , i still can't solve this problem. I will appreciate if you can help.

Thanks

mykelcodex left a reply on Restart Numbering In View

@Snapey , it's just for reference purpose...nothing more

mykelcodex left a reply on Restart Numbering In View

Thanks @grenadecx and @Vilfago .... later got another logic as well

@foreach ($aaa as $value) {{ $i}} {{$value->name}} @endforeach

mykelcodex started a new conversation Restart Numbering In View

Please how can i start my id from '1' in my view.

vieww

wwwwMewlana Jalaluddin Rumi How Long

Thanks

02 Jul
11 months ago

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

@Snapey , do I need to create a relationship between the video and the scorescheet?

30 Jun
11 months ago

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

@Snapey , there is no relationship between video and scorescheet. But there is relationship between adjudicators and scorescheet

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

@Cronix , yes this is my entire view for the video. And the method is

videos()

29 Jun
11 months ago

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

@Cronix , i tried this but it keep throwing an error, Method lluminate\Database\Query\Builder does not exist. below is my controller

 public function admin(){
        $tvideos = Upload::all()->count();
        $tpart = User::all()->count();
        return view('admin.index')->with('tvideos', $tvideos)
                                  ->with('tpart', $tpart);    

    }
    public function videos(){

        $videos = Upload::all();

        return view('admin.videos')->with('videos', $videos);    

    }
    public function login(){

        return view('login');    

    }
    
    public function counter(){
        $data = array(
        $africas = Upload::where('agency','=','africa')->count(),
        $asia = Upload::where('agency','=','asia')->count(),
        $australia = Upload::where('agency','=','australia')->count(),
        $europe = Upload::where('agency','=','europe/united kingdom')->count(),
        $north = Upload::where('agency','=','north america')->count(),
        );
        return view('admin.counter')->with('data', $data);    

    }
    public function adjudicators(){

        return view('admin.adjudicators');    

    }
    public function participants(){
        $total = Upload::all()->count();
        $vp = Upload::where('category','like', '%' .'Voice and Percussion' .'%')->get();
        $dlf = Upload::where('category','like', '%' .'Drum Line Face Off' .'%')->get();
        $icr= Upload::where('category','like', '%' .'Innovative and Creative Rhythm' .'%')->get();
        $mp = Upload::where('category','like', '%' .'Melodic Percussion' .'%')->get();
        $dks = Upload::where('category','like', '%' .'Drum Kit Solo' .'%')->get();
        $tr = Upload::where('category','like', '%' .'Traditional Rhythm' .'%')->get();
        return view('admin.participants')->with('dks',$dks)
                                         ->with('tr', $tr)
                                         ->with('mp', $mp)
                                         ->with('vp', $vp)
                                         ->with('dlf', $dlf)
                                         ->with('icr', $icr)
                                         ->with('total', $total);
                                            

    }
    public function update_profile(){

        return view('admin.profile');    

    }


    public function adjudicatorlist(){

        $adjudicators = User::all();    
        return view('admin.adjudicatorlist')->with('adjudicators', $adjudicators);    

    }


    public function adjudicatorscore($id){


        $scoresheets = User::find($id)->ScoreSheet;    
       
        return view('admin.adjudicatorscore')->with('scoresheets', $scoresheets);    

    }


    public function getPDF($id){

        
        $pdfs = User::find($id)->ScoreSheet;    
       
      $pdf = PDF::loadView('pdf.adjudicatorpdf',['pdfs'=>$pdfs]);
      return $pdf->stream('adjudicatorscore.pdf');    

    }

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

@Cronix , i was trying to do something like this in the scoresheet model

namespace App;

use Illuminate\Database\Eloquent\Model;

class ScoreSheet extends Model

{

protected $fillable =  array('user_id','pname','ref','adname','email','perf','crtv'
                            ,'arrange','sands','cstm','impr','gbal');

public function User()
{
    return $this->belongsTo('App\User', 'user_id');
}


public function if_scored(){

    return (Auth::check() && $this->user_id == Auth::user()->id);

}

}

then in my view

@if(Auth::scoresheet()->is_scored())
    display disabled button
@esle
    display button
@endif 

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

no @jcmargentina, below is what my video display looks like

video

when the adjudicator click the score participant button, it takes them to the single video page which looks like the

video2

I am using the hasMany relationship because all adjudicator of the same category will be scoring each video of that category.

So what i want is the logic to disabled the button after the each adjudicator score a video so that the video won't be available for scoring again.

Looking forward to your response

Thanks @jcmargentina

28 Jun
11 months ago

mykelcodex left a reply on Logic To Change Button After Adjudicator Score A Participant

Thanks @jcmargentina , I am working on a project that as to do with participants uploading a video to a category. I have six categories, under each category are different adjudicators. I used the has many relationships because each adjudicator of a category will be scoring the video uploaded to that category.

Problem: But I want the adjudicators to be able to score each category video once. After that the score button should be disabled so that they won't be able to score that particular video. How can I achieve that?

I will appreciate if you can help.

Thanks in advance.

27 Jun
11 months ago

mykelcodex started a new conversation Logic To Change Button After Adjudicator Score A Participant

What logic can i use to change my button from 'score participant' to 'scored' and disable it after an adjudicator scored a participant.I'm using the One to Many Relationship between two tables which are Scoresheet and Users. In the scoresheet table i have my user_id which references the users table id, each video also have a unique reference number, the whole idea is to ensure that adjudicator of same category cannot score a video uploaded to that category twice.

Below is what my table looks like

scoresheet1

24 Jun
1 year ago

mykelcodex started a new conversation Change Button 'Score Participant' To 'Scored'

What logic can i use to change my button from 'score participant' to 'scored' and disable it after an adjudicator scored a participant.I'm using the One to Many Relationship between two tables which are Scoresheet and Users. In the scoresheet table i have my user_id which references the users table id, each video also have a unique reference number, the whole idea is to ensure that adjudicator of same category cannot score a video uploaded to that category twice.

Please i need help!

19 Jun
1 year ago

mykelcodex left a reply on Scoring Each Participant By Adjudicator Of Same Category

Thank you @Thyrosis.... Yes, there are some fields designated for the allocation of score like g-balance, performance, stage usage etc..... Each participant a category can only score a video once.

18 Jun
1 year ago

mykelcodex started a new conversation Scoring Each Participant By Adjudicator Of Same Category

I'm working on a project that has to do with uploading a video by participant and I have adjudicators all over the globe to score each video uploaded. The adjudicators are in different categories.... Each participant have a unique reference number, but I'm stuck at the place where each adjudicator of the same category will score each participant's video.

Please I need help