tomasosho

tomasosho

CEO at TAP ventures & Edar Tech

Member Since 1 Year Ago

Abuja

Experience Points
6,620
Total
Experience

3,380 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
1
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.

Level 2
6,620 XP
Jul
23
3 weeks ago
Activity icon

Replied to A Reminder Pop Up

Yes I have. Cause I was using modal for alert, I stated that if the $condition is >= '1', it should display the alert.

Jul
14
1 month ago
Activity icon

Replied to I'm Trying To Send Html Mail

Lol... My mails are not being sent

Activity icon

Started a new Conversation I'm Trying To Send Html Mail

Controller

$data = array(
        'name'      =>  auth()->user()->name,
        'email'   =>   auth()->user()->email,
        'phone'   =>   auth()->user()->phone,
        'id'   =>   auth()->user()->id,
        'amount' => '15000',
        'date'   =>   Carbon\Carbon::now(),
        );

        Mail::to('email address')->send(new PayMail($data));
          
		return redirect('/');

Mail.php

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class PayMail extends Mailable
{
    use Queueable, SerializesModels;
    public $data;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($data)
    {
        $this->data = $data;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->from('email.com')->subject('Payment Completed')->view('payment')->with('data', $this->data);
    }
}

?>

Mail View


<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Subscription/Token Purchase</title>
    
    <style>
    .invoice-box {
        max-width: 800px;
        margin: auto;
        padding: 30px;
        border: 1px solid #eee;
        box-shadow: 0 0 10px rgba(0, 0, 0, .15);
        font-size: 16px;
        line-height: 24px;
        font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
        color: #555;
    }
    
    .invoice-box table {
        width: 100%;
        line-height: inherit;
        text-align: left;
    }
    
    .invoice-box table td {
        padding: 5px;
        vertical-align: top;
    }
    
    .invoice-box table tr td:nth-child(2) {
        text-align: right;
    }
    
    .invoice-box table tr.top table td {
        padding-bottom: 20px;
    }
    
    .invoice-box table tr.top table td.title {
        font-size: 45px;
        line-height: 45px;
        color: #333;
    }
    
    .invoice-box table tr.information table td {
        padding-bottom: 40px;
    }
    
    .invoice-box table tr.heading td {
        background: #eee;
        border-bottom: 1px solid #ddd;
        font-weight: bold;
    }
    
    .invoice-box table tr.details td {
        padding-bottom: 20px;
    }
    
    .invoice-box table tr.item td{
        border-bottom: 1px solid #eee;
    }
    
    .invoice-box table tr.item.last td {
        border-bottom: none;
    }
    
    .invoice-box table tr.total td:nth-child(2) {
        border-top: 2px solid #eee;
        font-weight: bold;
    }
    
    @media only screen and (max-width: 600px) {
        .invoice-box table tr.top table td {
            width: 100%;
            display: block;
            text-align: center;
        }
        
        .invoice-box table tr.information table td {
            width: 100%;
            display: block;
            text-align: center;
        }
    }
    
    /** RTL **/
    .rtl {
        direction: rtl;
        font-family: Tahoma, 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
    }
    
    .rtl table {
        text-align: right;
    }
    
    .rtl table tr td:nth-child(2) {
        text-align: left;
    }
    </style>
</head>

<body>
    <div class="invoice-box">
        <table cellpadding="0" cellspacing="0">
            <tr class="top">
                <td colspan="2">
                    <table>
                        <tr>
                            <td class="title">
                                <img src="{{asset('new/images/logo.png')}}" style="width:100%; max-width:300px;">
                            </td>
                            
                            <td>
                                Invoice #: {{ $data['id'] }}<br>
                                Created: {{ $data['date'] }}<br>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            
            <tr class="information">
                <td colspan="2">
                    <table>
                        <tr>
                            <td>
title                                
<br>
                                [email protected]<br>
                            </td>
                            
                            <td>
                                {{ $data['name'] }}<br>
                                {{ $data['email'] }}<br>
                                {{ $data['phone'] }}
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            
            <tr class="heading">
                <td>
                    Payment Method
                </td>
                
                <td>
                    Vogue #
                </td>
            </tr>
            
            <tr class="details">
                <td>
                    Subscription/Token Purchase
                </td>
                
                <td>
                    {{ $data['amount'] }}
                </td>
            </tr>
            
            <tr class="heading">
                <td>
                    
                </td>
                
                <td>
                    Total
                </td>
            </tr>
            
            <tr class="item">
                <td>
                    Sub-Total
                </td>
                
                <td>
                    {{ $data['amount'] }}
                </td>
            </tr>
            
            <tr class="item">
                <td>
                    Tax
                </td>
                
                <td>
                    0.00
                </td>
            </tr>
            
            <tr class="total">
                <td></td>
                
                <td>
                   Total: {{ $data['amount'] }}NGN
                </td>
            </tr>
        </table>
    </div>
</body>
</html>
Activity icon

Awarded Best Reply on Error On Deleting User Account

I created the table manually already since it's hosted and it's working now. Thanks

Activity icon

Replied to Error On Deleting User Account

I created the table manually already since it's hosted and it's working now. Thanks

Activity icon

Started a new Conversation Error On Deleting User Account

I intslled spatie permission, now i'm getting this error when o try to delete a user account. how do i uninstall spatie completely or fix error? Please note, the website is already hosted.

Illuminate\Database\QueryException
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elitefb0_esther.model_has_permissions' doesn't exist (SQL: delete from `model_has_permissions` where `model_id` = 2030 and `model_type` = App\User)
Jul
07
1 month ago
Activity icon

Replied to Field Doesn't Have Default Value.

for user relation to order, you can use one to one relationship

https://laravel.com/docs/7.x/eloquent-relationships#one-to-one
Activity icon

Replied to Turbolinks And File Download

I think you should include the id to the route link for the get route.

Activity icon

Replied to How To Calculate Aggregate Sum Of A Table Column

@martinbean my advice would be if he's trying to get the sum of a unique goal, then he should define and find that link in the controller using a unique identifier or if he's trying to sum up all the goals, he can do that in the controller, then just parse it in the view outside the foreach.

Activity icon

Replied to Field Doesn't Have Default Value.

why not add column to save the $user_id in the database, then you define your $user_id in your controller, then parse it in? This way, you'd stop the error.

Activity icon

Replied to How To Calculate Aggregate Sum Of A Table Column

I don't understand the question, but try this

{{$goal->sum("weighted_score ?? '' ") }}
Activity icon

Replied to String Not Changing To What It Should Be In The Email

can we see your blade view?

Jul
06
1 month ago
Activity icon

Started a new Conversation Tinker

how can i use tinker to generate actual news contents within a set date?

Jul
04
1 month ago
Activity icon

Awarded Best Reply on Payment Form Submission

Solved...

Activity icon

Replied to Payment Form Submission

Solved...

Activity icon

Started a new Conversation How Can I Use Javascript To Submit A Form If Response From A Pop Up Is Successful/approved

pop up script

<script src="https://voguepay.com/js/voguepay.js"></script>

            <form id='payform' onsubmit='return false;' method='POST' action='https://voguepay.com/pay/'>
              {{csrf_field()}}

              <input type='hidden' name='v_merchant_id' value='demo' />
              <input type='hidden' name='memo' value='Model-Subcription' />
              <input type='hidden' name='item_x' value='Model-Subcription' />
              <input type='hidden' name='price_x' value='1000.00' />
              <input type='hidden' name='cur' value='NGN' />

              <input type='hidden' name='success_url' value='/subscribes' />

              <input type='hidden' name='email' value='{{ auth()->check()?auth()->user()->email: null}}'/>

              <input type='hidden' name='developer_code' value='5eff843e04e99' />

              <input type='image' src='https://voguepay.com/images/buttons/make_payment_green.png' alt='Submit' />

            </form>
            <script>
              Voguepay.init({form:'payform'});
            </script>

The form i want it to submit

<form action="/subscribe" id="myform" name="myform" method="POST">
                    {{csrf_field()}} 
</form>
Jul
03
1 month ago
Activity icon

Started a new Conversation Payment Form Submission

i want it to post to store after submission.

<script src="https://voguepay.com/js/voguepay.js"></script>

            <form id='payform' method='POST' action='https://voguepay.com/pay/'>
              {{csrf_field()}}

              <input type='hidden' name='v_merchant_id' value='demo' />
              <input type='hidden' name='memo' value='Model-Subcription' />
              <input type='hidden' name='item_x' value='Model-Subcription' />
              <input type='hidden' name='price_x' value='1000.00' />
              <input type='hidden' name='cur' value='NGN' />

              <input type='hidden' name='success_url' value="{{ url('/subscribe') }}" />

              <input type='hidden' name='email' value='{{ auth()->check()?auth()->user()->email: null}}'/>

              <input type='hidden' name='developer_code' value='5eff843e04e99' />

              <input type='image' src='https://voguepay.com/images/buttons/make_payment_green.png' alt='Submit' />

            </form>
            <script>
              Voguepay.init({form:'payform'},);
            </script>

<script>
    closedFunction=function() {
        alert('window closed');
    }

     successFunction=function(transaction_id) {
        alert('Transaction was successful, Ref: '+transaction_id)
    }

     failedFunction=function(transaction_id) {
         alert('Transaction was not successful, Ref: '+transaction_id)
    }
</script>

It's meant to post the success_url which is a hidden input but it's not. how can i use javascript to post it after payment is successful?

<input type='hidden' name='success_url' value="{{ url('/subscribe') }}" />
Jun
26
1 month ago
Activity icon

Started a new Conversation Eloquent And Css

I am trying to input my image wallpaper link in my .css but it's not working

.timeline-cover{
	background: url("../storage/wallpapers/$user->image") no-repeat;
}
Jun
23
1 month ago
Activity icon

Replied to Is Thre A Way To Convert An Integer To A Day Of The Week

It depends on how you want to save it though; if you want to save as date you use

$today = date("Y-m-d");

While if you want to save it as variables e.g (mon, tues, wed), you could represent it as

if ($request->input('date') == '1') {
	$date = 'mon'
}
if ($request->input('date') == '2') {
	$date = 'tues'
}
...
Activity icon

Started a new Conversation BadMethodCallException Method Illuminate\Database\Eloquent\Collection::paginate Does Not Exist.

I am trying to paginate this

$favoritevideo = Auth::user()->favoriteprivatevideos->paginate(5);
$favoritepicture = Auth::user()->favoriteprivatepictures->paginate(5);
Jun
13
2 months ago
Activity icon

Started a new Conversation I'm Trying To Write If Statements But I'm Getting An Error

It's getting a Call to a member function latest() on null error on the first statement, what can i do?

$garageactivity = Garage::find($id)->garageactivity;
        $fuel = Garage::findorfail($id)->fuel;
        //dd($fuel);
        if ($garageactivity != NULL Or $fuel != NULL) {
            $items = StoreItem::count();
            $machines = StoreItem::count();
            $maintenances = StoreItem::count();
            $fuel = Garage::findorfail($id)->fuel->latest()->take($id)->first();
            $garageactivity = Garage::find($id)->garageactivity->latest()->take($id)->first();
            $garage = Garage::find($id);
            //dd($garageactivity);
            return view('garage.show', compact('garage', 'fuel', 'garageactivity', 'items', 'machines', 'maintenances'));
        }

        else if ($garageactivity != NULL) {
            $items = StoreItem::count();
            $machines = StoreItem::count();
            $maintenances = StoreItem::count();
            //$fuel = Garage::find($id)->fuel->latest()->take($id)->first();
            $garageactivity = Garage::find($id)->garageactivity->latest()->take($id)->first();
            $garage = Garage::find($id);
            //dd($garageactivity);
            return view('garage.show', compact('garage', 'garageactivity', 'items', 'machines', 'maintenances'));
        }
        
        if ($fuel != NULL) {
            $items = StoreItem::count();
            $machines = StoreItem::count();
            $maintenances = StoreItem::count();
            $fuel = Garage::find($id)->fuel->latest()->take($id)->first();
            $garage = Garage::find($id);
            //dd($garageactivity);
            return view('garage.show', compact('garage', 'fuel', 'items', 'machines', 'maintenances'));
        }
        $items = StoreItem::count();
        $machines = StoreItem::count();
        $maintenances = StoreItem::count();
        //$garageactivity = Garage::find($id)->garageactivity->latest()->take($id)->first();
        $garage = Garage::find($id);
        //dd($garageactivity);
        return view('garage.show', compact('garage', 'items', 'machines', 'maintenances'));
Jun
11
2 months ago
Activity icon

Replied to I Am Trying To Display From Two Tables Using A Relationship Of Id And Product_id

Something like this below:

$date = DB::table('garage_activities')->select('date')->get();
$garageactivities= $garage->Garage::whereSub(GarageActivity::latest()->select('product_id', DB::raw('DATE_FORMAT(date, "%Y-%b") as `month`'), 'date')
        ->groupBy('type', DB::raw('MONTH(date)'))
        ->get();
Activity icon

Replied to I Am Trying To Display From Two Tables Using A Relationship Of Id And Product_id

Yes, how can i group it by date? using foreach array?

Activity icon

Replied to I Am Trying To Display From Two Tables Using A Relationship Of Id And Product_id

i'm displaying my output in show so, i don't want to use a foreach. I want the activities to display the latest alone, then the garage to display the parent data.

OR

If i'm to use a foreach, how can i group it to date?

Activity icon

Replied to I Am Trying To Display From Two Tables Using A Relationship Of Id And Product_id

@tykus I want to get the most recent for

$garageactivity = Garage::find($id)->latest('garageactivity');

The above is not working.

Activity icon

Replied to I Am Trying To Display From Two Tables Using A Relationship Of Id And Product_id

I used a One To One Relationship in my models

Garage Model

public function garageactivity()
    {
        return $this->hasOne('App\GarageActivity', 'product_id');
    } 

GarageActivity Model

public function garage()
    {
        return $this->belongTo('App\Garage');
    } 

Controller

$garage = Garage::find($id)->garageactivity;

It's working with this!

Activity icon

Started a new Conversation I Am Trying To Display From Two Tables Using A Relationship Of Id And Product_id

I have tried this, but no luck

$garage = Garage::find($id);
        $act = GarageActivity::all();
        //dd($garage->id);
        $garageactivity = GarageActivity::find($garage->id == $act->product_id);
        dd($garageactivity);
Jun
06
2 months ago
Activity icon

Replied to Url()->previous() Goes Back To Base Url

url()->back()

try

{{ url()->previous() }}

OR

{{ url()->back() }}

OR

{{ Redirect::back() }}
Activity icon

Replied to SQLSTATE[HY000] [2006] MySQL Server Has Gone Away Laravel Mysql And Xampp

run php artisan serve instead of opening it directly

Activity icon

Replied to How To Create A Search And Select Input Field For Barcode Scanner

i'd need to submit the id Take for example i scanned product with barcode 001pro, how would i capture the id of the product too when the form is submitted?

Activity icon

Replied to I Used Sqlite For A Social Media Project

Thanks, i was able to convert it offline.

Activity icon

Started a new Conversation How To Create A Search And Select Input Field For Barcode Scanner

i want to create a search and select input field that brings result when scanned with a bar code scanner. I want it to work like a drop down select field. but instead of the drop down, i just want an input field and when a data is select and submited, i can pick up the data's id

Jun
04
2 months ago
Activity icon

Replied to I Used Sqlite For A Social Media Project

are there no free offline converters?

Activity icon

Replied to I Used Sqlite For A Social Media Project

Lol... I was trying to do that, then I lost all my data, I just have a little piece left now though.

Activity icon

Replied to I Used Sqlite For A Social Media Project

Thanks it's been a real pain. Will try this.

Jun
01
2 months ago
Activity icon

Replied to I Used Sqlite For A Social Media Project

I think for best practice, it's best you run everything from scratch. I think vue.js is an excellent choice, especially when you have to deal with follow, unfollow, messaging and others.

Activity icon

Started a new Conversation I Used Sqlite For A Social Media Project

The size just keeps increasing at an exponential level. it's about 18gig now. I am using a shared hosting platform. is there a way i could convert from sqlite to mysql without losing any info?

May
19
2 months ago
Activity icon

Replied to I Am Trying To Send Mail Automatically From My Controller

I'm trying to send the mail once the if requirement is met. The mail is dependent on the if requirement which should be automatic @prasadchinwal5

Activity icon

Replied to I Am Trying To Send Mail Automatically From My Controller

So i'm guessing the mail will be sent once the if requirement is met yes? @drewdan

May
18
2 months ago
Activity icon

Replied to Call To A Member Function DiffForHumans() On Null (View: C:\xampp\htdocs\project\news\resources\views\front\home.blade.php)

Try this

$hot_news = Post::with('creator')->withCount('comments')->where('hot_news')->where('status')->orderBy('id','DESC')->first();
Activity icon

Replied to Call To A Member Function DiffForHumans() On Null (View: C:\xampp\htdocs\project\news\resources\views\front\home.blade.php)

Try this

@if($hot_news->count() >= 1)

<div class="feature_article_inner">
                        <div class="tag_lg red"><a href="{{ url('/details') }}/{{ $hot_news['slug'] }}">Hot News</a></div>
                        <div class="feature_article_title">
                            <h1><a href="{{ url('/details') }}/{{ $hot_news['slug'] }}" target="_self">{{ $hot_news['title'] }} </a></h1>
                        </div>
                         <!-- feature_article_title -->

 <div class="feature_article_date">
    by: <a href="{{ url('/author') }}/{{ $hot_news['creator']['id'] }}" >{{ $hot_news['creator']['name'] }}</a> ,
       &nbsp;{{$hot_news['created_at']->diffForHumans() }}           </a></div>
                        <!-- feature_article_date -->

                       <div style="font-size: 9.5pt; color: black; "> Views: {{ $hot_news['view_count'] }} </div>

                        <div class="feature_article_content">
                           {{ $hot_news['short_description'] }}
                        </div>
                        <!-- feature_article_content -->

                        <div class="article_social">
                             
                            <span><i class="fas fa-comment"></i><a href="{{ url('/details') }}/{{ $hot_news['slug'] }}">{{ $hot_news['comments_count'] }} Comments </a></span>
                        </div>
                        <!-- article_social -->

                    </div>
@else

<p> No Hot News </p>

@endif
Activity icon

Started a new Conversation I Am Trying To Send Mail Automatically From My Controller

will the code execute?

My Controller

public function mail()
    {
        $alert = Items::whereColumn('number', '<=', 'threshhold')->get();
        $notification = Maintenance::whereBetween('service_date', [today(), today()->addDays(5)])->get();
        
        if ($alert->count() >= 1 or $notification->count() >= 1) {
            foreach ($alert as $a){
                $alerts = $a->title .'for'. $a->title .'has'. $a->number .'left, which is below the Threshold of'. $a->threshhold .'Please restock quickly';
            }
            foreach ($notification as $n){
                $notifications = $n->machine_title. $n->description .'is due for servicing on'. $n->service_date. 'Thank You!';
            }

            Mail::to('email address')->send(new SendMailable($alerts, $notifications));
        }
    }

SendMailable

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendMailable extends Mailable
{
    use Queueable, SerializesModels;
    public $name;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($name)
    {
        $this->notifications = $notifications;
        $this->notifications = $notifications;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('/');
    }
}
Activity icon

Replied to How Cant I Embed An Html Video In Css Background

I'm not trying to adjust backgrounds. But thanks

Activity icon

Started a new Conversation How Cant I Embed An Html Video In Css Background

example (background-image:/link) i want the link to be a video instead of a picture.

I don't want to use ``` I am trying to make my video undownloadable to an extent, at least not with a simple right click

Activity icon

Started a new Conversation How Do I Encrypt A Link?

How do I encrypt a link so after every click the link changes?

May
14
3 months ago