Wraith

Wraith

Member Since 3 Months Ago

Experience Points
3,640
Total
Experience

1,360 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
22
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
3,640 XP
Jan
21
6 days ago
Activity icon

Replied to Laravel Passport - Custom Authorization Question

Override passport controller function :)

Activity icon

Replied to Keyup

Is not laravel is just JS and what is this? input[name='nominal1']

yoru name is unit and nominal

nominal1 and nominal2 is ID

you should use $("#nominal1").val() $("#nominal2").val()

Activity icon

Replied to Why Aren't My Relationships Returning Correctly?

this code doing exactly what you did :) we need code from location modesl and this belongs to many Location but what is the model ? dashboard ? alerts ? or what ? move to the bin this question and back with correct one

Activity icon

Replied to Laravel Query Chat

yes it is possible

Jan
07
2 weeks ago
Activity icon

Replied to Shorten Query

there is no too long line xD

->join('product_catalog_translations', 'product_catalogs.id', '=', 'product_catalog_translations.product_catalog_id')
Activity icon

Replied to I Want To Add An 'order By'(asc,desc) Buttons To My Product View Page

:) why u keep code in model class xD and what is this $viewData['page_title'] .= $products[0]->ctitle;

Activity icon

Replied to Laravel Backend API + Multiple Clients

there is no such a project like this xD

Jan
06
3 weeks ago
Activity icon

Replied to How To Store Update Data On Modal Laravel

  modal.find('.modal-body #nama_unit').val(nama_unit);

btw why u assign id , doesnt make sense u have the same name : nama_unit so first will be ignored , you have two inputs with the same name

Dec
17
1 month ago
Activity icon

Replied to Cartalyst/stripe-laravel: No Such Customer: Person

Thirst thing, what u have in

dd($request->stripeToken);
Dec
15
1 month ago
Activity icon

Awarded Best Reply on How To Send Push Notification To Android Using Laravel?

You don't need package just create function in controller to send cUrl data on https://fcm.googleapis.com/fcm/send and create Key as project ID

function sendPushNotification($fcm_token, $title, $message, $id = null) {  
    
        $url = "https://fcm.googleapis.com/fcm/send";            
        $header = [
        'authorization: key=' . $your_project_id_as_key,
            'content-type: application/json'
        ];    

        $postdata = '{
            "to" : "' . $fcm_token . '",
                "notification" : {
                    "title":"' . $title . '",
                    "text" : "' . $message . '"
                },
            "data" : {
                "id" : "'.$id.'",
                "title":"' . $title . '",
                "description" : "' . $message . '",
                "text" : "' . $message . '",
                "is_read": 0
              }
        }';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

        $result = curl_exec($ch);    
        curl_close($ch);

        return $result;
    }
Dec
10
1 month ago
Activity icon

Replied to How Build App Like Chaturbate ?

no it is the same script with changing logo etc.

Dec
08
1 month ago
Activity icon

Started a new Conversation How Build App Like Chaturbate ?

Hi, i would like create app similar like chaturbate. Any suggestion what is the best media streaming ?

Activity icon

Replied to Problems With Uploading File Using Vue.js And Laravel

foreach ($formData as $key => $value) {
        if($key[$value] == 'fileUpload') {
            dd($key['value']);
        }
    }
Activity icon

Replied to Cartalyst/stripe-laravel: No Such Customer: Person

This looks like callback, show screen from error and check what u have in request. This func is just simple create record in stripe table you cant get message from this like , no such customer person

Activity icon

Replied to ERROR 2002 (HY000): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)

I suggest don't run any projects on mac book, i was the same, every system upgrade i had to change config again. Now i am using Docker and dont care anymore about configs

Activity icon

Replied to ERROR 2002 (HY000): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)

if you have error socket (2) means DB is not runing. Might be many ways to fix first

make backup and delete file /etc/my.cnf 

and restart DB

Activity icon

Replied to How To Create A Relationship And Join Table

For me product is one should be Products table and Stocks table. In Product you have basic info, In stock table you should have file stock_type = (1 - shop , 2 - warehouse) and . you keep all product id with ext. info like qty, price, etc .

And than in sale you can select product assign to shop or warehouse .

Activity icon

Replied to Socialite Google Works On Localhost Only

go to config/session.php and set (without www)

'domain' => env('SESSION_DOMAIN', yourdomain.com),

and in console

php artisan cache:clear
composer dump-autoload

Delete all cookies from browser

Activity icon

Replied to How To Create A Relationship And Join Table

You have to create 3 models

Product.php Dont need put belongsTo for now

Itemstock.php

public function product() {
    return hasOne('App\Product', 'id', 'item_id');
}

Sale.php

public function product() {
    return hasOne('App\Product', 'id', 'item_id');
}

Now

$abc = Sale::where('item_id', $id)->first();
dd($abc->product);

You should see relations from products table, and i hope you have made relations foreign keys in DB

Activity icon

Replied to Dabble In Laravel Will Beneficial From Laracasts

to pass ID to JS file in view you have to create global param

<script>
var myID = {{ $data->id }}; 
</script>

and u can use myID in JS file

Activity icon

Replied to How To Create A Relationship And Join Table

What is Itemstock ? and What is Products ? What is Item_id in Sales and Itemstock ? You tables are shit. Delete this

Products table:
id - key
category_id - relation in future to other table
name - varchar or text

Itemstocks - table
id - key
product_id - relation to your products table
qty - int
rate -
amount -

Sales - table
id - key
item_id - ??? you want relation one to one with Itemstocks or what ? deosnt make sense
Activity icon

Replied to LaraStreamer - A Laravel Package To Stream Video Content.

And can i create sex showup website now :) ?

Activity icon

Replied to How To Send Push Notification To Android Using Laravel?

You don't need package just create function in controller to send cUrl data on https://fcm.googleapis.com/fcm/send and create Key as project ID

function sendPushNotification($fcm_token, $title, $message, $id = null) {  
    
        $url = "https://fcm.googleapis.com/fcm/send";            
        $header = [
        'authorization: key=' . $your_project_id_as_key,
            'content-type: application/json'
        ];    

        $postdata = '{
            "to" : "' . $fcm_token . '",
                "notification" : {
                    "title":"' . $title . '",
                    "text" : "' . $message . '"
                },
            "data" : {
                "id" : "'.$id.'",
                "title":"' . $title . '",
                "description" : "' . $message . '",
                "text" : "' . $message . '",
                "is_read": 0
              }
        }';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

        $result = curl_exec($ch);    
        curl_close($ch);

        return $result;
    }
Activity icon

Replied to LAMP On Ubuntu

move test.php to html folder or create vhost you should disable default site cd /etc/apache/2sites-available/ and you should see 000-default you have to disable: a2dissite 000-deafult.conf

Activity icon

Replied to Is It Possible To Sent Email Dynamically With Laravel Email?

Steps:

  1. move template email from vendor project to your resources
  2. create email template with placeholders for vendor's company logo, vendor's company data, vendor's client data, invoice position
  3. install pdf creator - phantom JS or other one
  4. prepare controller, view and route for (create, view) invoices
  5. and when vendor click send email with invoice get order ID and create pdf + after send email

You should create queue : 1 - create pdf and after add email to queue

  1. create job fails table and if fail send email to vendor and you as administrator
Dec
07
1 month ago
Activity icon

Replied to Laravel Controller Edit Function Issue.

Don't do this in that way. I suggest

Route::get('/brightstudent/{brightStudent}/edit', '[email protected]')->name('bright-student');

<a class="dropdown-item" href="{{ route('bright-student', [$brightstudent]) }}"> <i class="fas fa-user-edit nav-icon"></i> Edit</a>

because you using model in controller

public function edit(BrightStudent $brightStudent)

so Laravel will take ID

Activity icon

Replied to Hit Controller Manually And Send Data To It

Route is always before controller. Or you mean in controller run function from another controller ?

Activity icon

Replied to Task Scheduling - No Scheduled Commands Are Ready To Run.

php artisan cache:clear

Everytime when you change job, cron, schedule u have to clear cache

Activity icon

Replied to Export To XML Showing Error

Like Error said Writer is not good for this type of doc. Maybe you can use PhpOffice\PhpSpreadsheet\Shared\ XMLWriter

https://phpoffice.github.io/PhpSpreadsheet/1.4.0/PhpOffice/PhpSpreadsheet/Shared/XMLWriter.html

Activity icon

Replied to Laravel XSRF-TOKEN Is Not Returned

in HEAD i have

    <meta name="csrf-token" content="{{ csrf_token() }}">

in ajax call i have

$.ajax({
       type: 'POST',
       url: url,
       data: datum,
       headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
       dataType: 'json',
       success: function (data) {
         callback(data);
         return true;
       },
       error: function (data) {
          console.log('ajax error', data);
       }
    });
Dec
02
1 month ago
Activity icon

Replied to Can't Generate Pdf In Background

var/www/vendor/h4cc/

i dont think so u have vendor in www dir :) where is project name ?

Activity icon

Replied to Login Api

Means he is hungry as well :)

Nov
18
2 months ago
Activity icon

Replied to PHP 7.3 Curl SSL Error

Looks like your openssl is not the same like on BB or they are not support the same cypher version as your on mac

Activity icon

Replied to Login Api

I am hungry, and u ?

Activity icon

Replied to Cashier + BrainTree For Expired Subscriptions

Every time when u try get money for continue subscription you should get callback from provider with user id, amount or subscription id when u can find user. If will be negative just revoke sub from user.

Nov
15
2 months ago
Activity icon

Replied to PHP 7.3 Curl SSL Error

What system u using ?

Activity icon

Replied to Laravel Forge Subdomain Not Working

Paste Virtual Server settings and .htaccess

Activity icon

Replied to Can't Related Three Table While Inserting Data

first yoy saved product and using this product model to save conditiontest like $product->conditiontest()->saveMany right? but before u have if(isset($value['value'])) and after this if u have $condition->foodsimulant()->saveMany but what if if(isset($value['value'])) return false ? u still trying save $condition->foodsimulant()->saveMany without any $condition product like $product->conditiontest->foodsimulant()->saveMany

What is your $condition ? where u create model ?

Activity icon

Replied to I Am Try To Search My Record (use Laravel And Vue Js )

You have to create own pagination system:

$data = DB::select($sql); $pageNo = 1; $size = 10; $collect = collect($data);

$pagination = new LengthAwarePaginator($collect->forPage($pageNo, $size), $collect->count(), $size, $pageNo);

Activity icon

Replied to Does Schedule:run Have To Run Exactly Every Minute?

scheduler will always run new task, doesnt matter when job will be finish. In this case you have to care about flag.

  1. start job at 14:30 and set flag job_name = 1
  2. Start the same job at 14:31 and check flag if is job_name = 1 do nothing if flag = 0 do job
  3. finish job from 14:30 set flag = 0
  4. repeat
Nov
14
2 months ago
Activity icon

Replied to Nothing

we need table and method inventories :)

Activity icon

Replied to Polymorphic HasMany

Now you have image, video, audio model and using polymorphic for comments only. In comments table you have model name. You can join collection together, cause there is nothing to do with polymorphic, or you can create one table like (media) and put all in there with field type_id (1 - image, 2 - video, 3 - audio) and don't need polymorphic tables.