GregorSams

GregorSams

Member Since 2 Years Ago

Experience Points 550
Experience Level 1

4,450 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 0
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.

27 Jan
7 months ago

GregorSams started a new conversation Laravel Is Not Loading File Css File Correctly

I have created the following layout:

enter image description here

As you can see in the snipped below I am trying to use github as cdn, using gitcdn.link.

However, when loading <link href="assets/css/components.min.css" rel="stylesheet" type="text/css"> as github link, such as <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/components.min.css" rel="stylesheet" type="text/css"> -I get the layout below:

enter image description here

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>Test</title>

        <!-- Global stylesheets -->
        <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
        
        <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
        
        <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
        <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
        <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/bootstrap_limitless.min.css" rel="stylesheet" type="text/css">
        <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/layout.min.css" rel="stylesheet" type="text/css">
      <!-- ERROR FILE BELOW -->
        <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/components.min.css" rel="stylesheet" type="text/css">
        <!-- /ERROR FILE BELOW -->

        <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/colors.min.css" rel="stylesheet" type="text/css">
        <!-- /global stylesheets -->

        <!-- Core JS files -->
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/main/jquery.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/main/bootstrap.bundle.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/loaders/blockui.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/ui/slinky.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/ui/ripple.min.js"></script>
        <!-- /core JS files -->
        
        <!-- Load plugin -->
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/tables/datatables/datatables.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/extensions/jquery_ui/widgets.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/extensions/jquery_ui/touch.min.js"></script>

        <!-- Used for Multiselects -->
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/forms/styling/uniform.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/notifications/pnotify.min.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/forms/selects/bootstrap_multiselect.js"></script>    
        <!-- /load plugin -->   
        <!-- Theme JS files -->

        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/js/app.js"></script>
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/demo_pages/jqueryui_sliders.js"></script>
        
        <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/demo_pages/form_multiselect.js"></script>

        <!-- /Theme JS files -->
    </head>

    <body class="navbar-top">

        <!-- Main navbar -->
        <div class="navbar navbar-expand-md navbar-dark bg-indigo fixed-top">
            <div class="navbar-brand wmin-0 mr-5">
                <a href="index.html" class="d-inline-block">
                </a>
            </div>
            </div>
        </div>
        <!-- /main navbar -->

        <!-- Page header -->
        <div class="page-header">
            <div class="page-header-content header-elements-md-inline">
                <div class="page-title d-flex">
                    <h4><i class="icon-arrow-left52 mr-2"></i> <span class="font-weight-semibold">Home</span> - Dashboard</h4>
                    <a href="#" class="header-elements-toggle text-default d-md-none"><i class="icon-more"></i></a>
                </div>

                <div class="header-elements d-none py-0 mb-3 mb-md-0">
                    <div class="breadcrumb">
                        <a href="index.html" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Home</a>
                        <span class="breadcrumb-item active">Dashboard</span>
                    </div>
                </div>
            </div>
        </div>
        <!-- /page header -->
            

        <!-- Page content -->
    <div class="page-content pt-0">

        <!-- Main content -->
        <div class="content-wrapper">

            <!-- Content area -->
            <div class="content">

                <!-- Default ordering -->
                <div class="card">
                    <div class="card-header header-elements-inline">
                        <h5 class="card-title">Default ordering</h5>
                        <div class="header-elements">
                            <div class="list-icons">
                                <a class="list-icons-item" data-action="collapse"></a>
                                <a class="list-icons-item" data-action="reload"></a>
                                <a class="list-icons-item" data-action="remove"></a>
                            </div>
                        </div>
                    </div>

                    <div class="card-body">
                        <fieldset>
                            <legend class="font-weight-semibold"><i class="icon-cash4 mr-2"></i>Filter and Select</legend>

                            <!-- First Row -->
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Pairs:</label>
                                        <select id="pairDD" class="form-control multiselect-select-all-filtering"
                                                multiple="multiple" data-fouc>
                                            @foreach ($pairs as $p)
                                            <option value="{{ $p->pair }}">{{ $p->pair }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Symbol:</label>
                                        <select id="symbolDD" class="form-control multiselect-select-all-filtering"
                                                multiple="multiple" data-fouc>
                                            @foreach ($symbol as $s)
                                            <option value="{{ $s->symbol }}">{{ $s->symbol }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Lowest Price Range:</label>
                                        <div class="mb-1">
                                            <div class="ui-slider-horizontal jui-slider-range" data-fouc></div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Market Cap:</label>
                                        <div class="mb-1">
                                            <div class="ui-slider-horizontal jui-slider-range" data-fouc></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- /First Row -->

                            <!-- Second Row -->
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Algorithm:</label>
                                        <select id="pairDD" class="form-control multiselect-select-all-filtering"
                                                multiple="multiple" data-fouc>
                                            @foreach ($pairs as $p)
                                            <option value="{{ $p->pair }}">{{ $p->pair }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Exchange:</label>
                                        <select id="pairDD" class="form-control multiselect-select-all-filtering"
                                                multiple="multiple" data-fouc>
                                            @foreach ($pairs as $p)
                                            <option value="{{ $p->pair }}">{{ $p->pair }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Last Price Range:</label>
                                        <div class="mb-1">
                                            <div class="ui-slider-horizontal jui-slider-range" data-fouc></div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>Highest Price Range:</label>
                                        <div class="mb-1">
                                            <div class="ui-slider-horizontal jui-slider-range" data-fouc></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- /Second Row -->

                        </fieldset>
                    </div>
                </div>

                <div class="card">
                    <div class="card-header header-elements-inline">
                        <h5 class="card-title">Data</h5>
                        <div class="header-elements">
                            <div class="list-icons">
                                <a class="list-icons-item" data-action="collapse"></a>
                                <a class="list-icons-item" data-action="reload"></a>
                                <a class="list-icons-item" data-action="remove"></a>
                            </div>
                        </div>
                    </div>

                    <div class="card-body">

                        <table class="table datatable-responsive dataTable" style="width:100%">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>TICKER</th>
                                <th>SYMBOL</th>
                                <th>ALGORITHM</th>
                                <th>LAST</th>
                                <th>CHG %</th>
                                <th>CHG</th>
                                <th>HIGH</th>
                                <th>LOW</th>
                                <th>VOL</th>
                                <th>EXCHANGE</th>
                            </tr>
                            </thead>
                            <tbody>

                            <tr role="row" class="odd">
                                <td tabindex="0" class="sorting_1">1</td>
                                <td>OAX/ETH</td>
                                <td>OAX</td>
                                <td>N/A</td>
                                <td>0.00061720</td>
                                <td>-181.40%</td>
                                <td>-0.00001140</td>
                                <td>0.00065050</td>
                                <td>0.00060200</td>
                                <td>66,122</td>
                                <td>Binance</td>
                            </tr>
                            <tr role="row" class="odd">
                                <td class="sorting_1" tabindex="0">21</td>
                                <td>FTC/BTC</td>
                                <td>FTC</td>
                                <td>NeoScrypt</td>
                                <td>0.00000491</td>
                                <td>-219.12%</td>
                                <td>-0.00000011</td>
                                <td>0.00000504</td>
                                <td>0.00000491</td>
                                <td>100,623</td>
                                <td>Bittrex</td>
                            </tr>
                            <tr role="row" class="even">
                                <td class="sorting_1" tabindex="0">22</td>
                                <td>GAM/BTC</td>
                                <td>GAM</td>
                                <td>Scrypt</td>
                                <td>0.00035185</td>
                                <td>-56.24%</td>
                                <td>-0.00000199</td>
                                <td>0.00035666</td>
                                <td>0.00035184</td>
                                <td>359</td>
                                <td>Bittrex</td>
                            </tr>
                            <tr role="row" class="odd">
                                <td class="sorting_1" tabindex="0">23</td>
                                <td>GAME/BTC</td>
                                <td>GAME</td>
                                <td>Scrypt</td>
                                <td>0.00002091</td>
                                <td>111.22%</td>
                                <td>0.00000023</td>
                                <td>0.00002141</td>
                                <td>0.00002024</td>
                                <td>70,484</td>
                                <td>Bittrex</td>
                            </tr>
                            <tr role="row" class="even">
                                <td class="sorting_1" tabindex="0">24</td>
                                <td>GBYTE/BTC</td>
                                <td>GBYTE</td>
                                <td>N/A</td>
                                <td>0.00765870</td>
                                <td>563.49%</td>
                                <td>0.00040854</td>
                                <td>0.00765870</td>
                                <td>0.00724300</td>
                                <td>346</td>
                                <td>Bittrex</td>
                            </tr>
                            <tr role="row" class="odd">
                                <td class="sorting_1" tabindex="0">25</td>
                                <td>GRC/BTC</td>
                                <td>GRC</td>
                                <td>Scrypt</td>
                                <td>0.00000147</td>
                                <td>-200.00%</td>
                                <td>-0.00000003</td>
                                <td>0.00000150</td>
                                <td>0.00000146</td>
                                <td>22,902</td>
                                <td>Bittrex</td>
                            </tr>
                            <tr role="row" class="even">
                                <td class="sorting_1" tabindex="0">26</td>
                                <td>GUP/BTC</td>
                                <td>GUP</td>
                                <td>N/A</td>
                                <td>0.00000472</td>
                                <td>373.63%</td>
                                <td>0.00000017</td>
                                <td>0.00000493</td>
                                <td>0.00000439</td>
                                <td>630,792</td>
                                <td>Bittrex</td>
                            </tr>
                            <tr role="row" class="odd">
                                <td class="sorting_1" tabindex="0">27</td>
                                <td>HMQ/BTC</td>
                                <td>HMQ</td>
                                <td>N/A</td>
                                <td>0.00000234</td>
                                <td>493.27%</td>
                                <td>0.00000011</td>
                                <td>0.00000237</td>
                                <td>0.00000222</td>
                                <td>970,870</td>
                                <td>Bittrex</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- /default ordering -->

                <script>
                    $(document).ready(function () {
                        const table = $('.datatable-responsive').DataTable();
                        // Filtering Dropdown
                        $('#pairDD').on('change', function () {
                            let search = [];
                            $.each($('#pairDD option:selected'), function () {
                                search.push($(this).val());
                            });
                            search = search.join('|');
                            table.column(2).search(search, true, false).draw();
                        });
                        $('#symbolDD').on('change', function () {
                            let search = [];
                            $.each($('#symbolDD option:selected'), function () {
                                search.push($(this).val());
                            });
                            search = search.join('|');
                            table.column(2).search(search, true, false).draw();
                        });
                    });
                </script>
            </div>
            <!-- /content area -->
        </div>
        <!-- /main content -->
    </div>
    <!-- /page content -->

        <!-- Footer -->
        <div class="navbar navbar-expand-lg navbar-light">
            <div class="text-center d-lg-none w-100">
                <button type="button" class="navbar-toggler dropdown-toggle" data-toggle="collapse" data-target="#navbar-footer">
                    <i class="icon-unfold mr-2"></i>
                    Footer
                </button>
            </div>

            <div class="navbar-collapse collapse" id="navbar-footer">
                <span class="navbar-text">
                    &copy; 2015 - 2018.
                </span>
            </div>
        </div>
        <!-- /footer -->
            
    </body>
    </html>

When I load the file the following way it works:

<link href="assets/css/components.min.css" rel="stylesheet" type="text/css">

When trying it in laravel I still get the wrong layout as above:

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Test</title>

    <!-- Global stylesheets -->
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">

    <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">

    <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
    <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/bootstrap_limitless.min.css" rel="stylesheet" type="text/css">
    <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/layout.min.css" rel="stylesheet" type="text/css">
    <link href="{{ asset('assets/css/components.min.css')}}" rel="stylesheet" type="text/css">
    <link href="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/css/colors.min.css" rel="stylesheet" type="text/css">
    <!-- /global stylesheets -->

    <!-- Core JS files -->
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/main/jquery.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/main/bootstrap.bundle.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/loaders/blockui.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/ui/slinky.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/ui/ripple.min.js"></script>
    <!-- /core JS files -->

    <!-- Load plugin -->
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/tables/datatables/datatables.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/extensions/jquery_ui/widgets.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/extensions/jquery_ui/touch.min.js"></script>

    <!-- Used for Multiselects -->
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/forms/styling/uniform.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/notifications/pnotify.min.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/plugins/forms/selects/bootstrap_multiselect.js"></script>
    <!-- /load plugin -->

    <!-- Theme JS files -->

    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/assets/js/app.js"></script>
    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/demo_pages/jqueryui_sliders.js"></script>

    <script src="https://gitcdn.link/repo/marcpre/demo_cryptoscreener/master/_other/layout_html/global_assets/js/demo_pages/form_multiselect.js"></script>

    <!-- /Theme JS files -->
</head>

I have compared the local file with the github file and they are the same!

Any suggestions what I might do wrong?

30 Dec
8 months ago

GregorSams started a new conversation Jquery Datatable Does Not Load In Laravel 5.7

I am using Laravel Framework 5.7.19 and want to recreate the following example in my blade view https://datatables.net/examples/plug-ins/range_filtering.html :

Find below my layout app.blade.php:

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

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

    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css">

    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">

    <!-- ag-grid
    <script src="https://unpkg.com/ag-grid-enterprise/dist/ag-grid-enterprise.min.noStyle.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/ag-grid-community/dist/styles/ag-grid.css">
    <link rel="stylesheet" href="https://unpkg.com/ag-grid-community/dist/styles/ag-theme-balham.css">
-->
    <!-- jquery -->
    <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>

    <link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">


</head>
<body>
<div id="app">
    @include('layouts.nav.mainNav')

    <main class="py-4">
        @yield('content')
    </main>
</div>

<script>
    // out side of ready function
    /* Custom filtering function which will search data */
    $.fn.dataTable.ext.search.push(
        function (settings, data, dataIndex) {
            var min = parseInt($('#min').val(), 10);
            var max = parseInt($('#max').val(), 10);
            var age = parseFloat(data[3]) || 0; // use data for the age column

            if ((isNaN(min) && isNaN(max)) ||
                (isNaN(min) && age <= max) ||
                (min <= age && isNaN(max)) ||
                (min <= age && age <= max)) {
                return true;
            }
            return false;
        }
    );
    // out side of ready function end

    $(document).ready(function () {
        var table = $('#example').DataTable();

        // Event listener to the two range filtering inputs to redraw on input
        $('#min, #max').keyup(function () {
            table.draw();
        });
    });
</script>

</body>

</html>

Find below my current datatable implementation datatable.blade.php:

@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row justify-content-center">
            <div class="">

                <table border="0" cellspacing="5" cellpadding="5">
                    <tbody>
                    <tr>
                        <td>Minimum age:</td>
                        <td><input type="text" id="min" name="min"></td>
                    </tr>
                    <tr>
                        <td>Maximum age:</td>
                        <td><input type="text" id="max" name="max"></td>
                    </tr>
                    </tbody>
                </table>
                <table id="example" class="display" style="width:100%">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Position</th>
                        <th>Office</th>
                        <th>Age</th>
                        <th>Start date</th>
                        <th>Salary</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>Tiger Nixon</td>
                        <td>System Architect</td>
                        <td>Edinburgh</td>
                        <td>61</td>
                        <td>2011/04/25</td>
                        <td>0,800</td>
                    </tr>
                    <tr>
                        <td>Garrett Winters</td>
                        <td>Accountant</td>
                        <td>Tokyo</td>
                        <td>63</td>
                        <td>2011/07/25</td>
                        <td>0,750</td>
                    </tr>
                    <tr>
                        <td>Ashton Cox</td>
                        <td>Junior Technical Author</td>
                        <td>San Francisco</td>
                        <td>66</td>
                        <td>2009/01/12</td>
                        <td>,000</td>
                    </tr>
                    <tr>
                        <td>Cedric Kelly</td>
                        <td>Senior Javascript Developer</td>
                        <td>Edinburgh</td>
                        <td>22</td>
                        <td>2012/03/29</td>
                        <td>3,060</td>
                    </tr>
                    <tr>
                        <td>Airi Satou</td>
                        <td>Accountant</td>
                        <td>Tokyo</td>
                        <td>33</td>
                        <td>2008/11/28</td>
                        <td>2,700</td>
                    </tr>
                    <tr>
                        <td>Brielle Williamson</td>
                        <td>Integration Specialist</td>
                        <td>New York</td>
                        <td>61</td>
                        <td>2012/12/02</td>
                        <td>2,000</td>
                    </tr>
                    <tr>
                        <td>Herrod Chandler</td>
                        <td>Sales Assistant</td>
                        <td>San Francisco</td>
                        <td>59</td>
                        <td>2012/08/06</td>
                        <td>7,500</td>
                    </tr>
                    </tbody>
                    <tfoot>
                    <tr>
                        <th>Name</th>
                        <th>Position</th>
                        <th>Office</th>
                        <th>Age</th>
                        <th>Start date</th>
                        <th>Salary</th>
                    </tr>
                    </tfoot>
                </table>

            </div>
        </div>
    </div>
@endsection

This is how currently my table looks like:

alt text

As you can see I get the error:

Uncaught TypeError: $(...).DataTable is not a function

Any suggestions what I am doing wrong?

14 Jan
1 year ago

GregorSams started a new conversation Add Validation To Repeater Field

I am using Laravel 5.5 and I am using the jquery repeater field.

Find below my frontend:

    @extends('layouts.app') @section('content')
    <div class="panel-body">
        {{-- display success message --}} @if (Session::has('success'))
        <div class="alert alert-success">
            <strong>Success:</strong> {{ Session::get('success') }}
        </div>
        @endif {{-- display error message --}} @if (count($errors) > 0)
        <div class="alert alert-danger">
            <strong>Error:</strong>
            <ul>
                @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
        @endif
    </div>
    
    <!-- Form -->
    <form action="{{ route('instrument.updateDetails', [$instrumentUnderEdit->id]) }}" method='POST' class="repeater" enctype="multipart/form-data">
        {{ csrf_field() }}
        <label>Firstname</label>
        <label>Lastname</label>
        <label>Twitter</label>
        <div data-repeater-list="team">
            <div data-repeater-item>
    
                <input type="text" name="firstName" value='{{ $instrumentUnderEdit->firstName }}' />
    
                <input type="text" name="lastName" value='{{ $instrumentUnderEdit->lastName }}' />
    
                <input type="text" name="twitter" value='{{ $instrumentUnderEdit->twitter }}' />
    
                <input data-repeater-delete type="button" value="Delete" />
            </div>
        </div>
        <input data-repeater-create type="button" value="Add" />
        </br>
        </br>
        <div class="row">
            <div class="form-group col-xs-5 col-lg-1">
                <label>User Name*</label>
                <input type="text" name="userName" class="form-control" placeholder="Insert your contributor name" style="width: 250px;"> </div>
        </div>
        <input type="hidden" name='_method' value='POST'>
        <input type="submit" class='btn btn-success btn-sm' value='Update'>
    </form>
    @endsection

I am using the following in my backend for validation:

        $this->validate($request, [
            'firstName' => 'nullable|min:2|max:190',
            'lastName' => 'nullable|min:3|max:190',
            'twitter' => 'nullable|min:3|max:190',
            'userName' => 'required|min:1|max:190',
        ]);

Currently, the repeater field does not valide correctly. I am guessing that the reason for this is that in the request the name attribute is rendered as the following f.ex.: "team[1][firstName]", "team[2][firstName]" whereas the number indicates the row of the field.

Any suggestions how to add validation to each repeater field?

Thx in advance for your replies!

01 Jan
1 year ago

GregorSams started a new conversation Load Db Data Into Javascript File

I am using Laravel 5.5 and I am trying to work with ag-grid and want to load my data that is coming from my db directly into the Javascript file.

My Migration looks like the following:

    public function up()
    {
        Schema::create('tasks', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->timestamps();
        });
    }

My Frontend looks like the following:

example.js

    // specify the columns
    var columnDefs = [
        {headerName: "Name", field: "name"},
        {headerName: "Created_At", field: "created_at"},
        {headerName: "Updated_At", field: "updated_at"}
    ];
    
    // specify the data
    var rowData = [
        {name: "TODO 1", created_at: "01.01.2018", updated_at: "05.11.2016"},
        {name: "TODO 1", created_at: "01.01.2018", updated_at: "05.11.2016"} // HERE I would like to replace this dummy data with my db data
    ];
    
    // let the grid know which columns and what data to use
    var gridOptions = {
        columnDefs: columnDefs,
        rowData: rowData,
        onGridReady: function () {
            gridOptions.api.sizeColumnsToFit();
        }
    };
    
    // used in our jasmine test
    function selectAllRows() {
        gridOptions.api.selectAll();
    }
    
    // wait for the document to be loaded, otherwise ag-Grid will not find the div in the document.
    document.addEventListener("DOMContentLoaded", function () {
        // lookup the container we want the Grid to use
        var eGridDiv = document.querySelector('#myGrid');
    
        // create the grid passing in the div to use together with the columns & data we want to use
        new agGrid.Grid(eGridDiv, gridOptions);
    });

home.blade.php

    <html>
    
    <head>
        <script src="https://www.ag-grid.com/dist/ag-grid/ag-grid.js"></script>
        <script src="example.js"></script>
    </head>
    
    <body>
        <h1>Ag-Grid Example</h1>
        <div id="myGrid" style="height: 115px;width:500px" class="ag-fresh"></div>
    
        <!-- Own Scripts -->
        <script src="{{ asset('js/example.js') }}"></script>
    </body>
    
    </html>

Any suggestions how to insert my data that I load from the database into the the variable rowData in my example.js file?

I appreciate your replies!

31 Dec
1 year ago

GregorSams started a new conversation Ag-Grid - Passing Data To Javascript File From Controller

Hello guys,

I am trying out Ag-Grid however, I do not know how to pass my data from my model Task to my js-script file.

Below is my backend:

Task migration:

    public function up()
    {
        Schema::create('tasks', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->timestamps();
        });
    }

Frontend - view

<html>

<head>
    <script src="https://www.ag-grid.com/dist/ag-grid/ag-grid.js"></script>
    <script src="example.js"></script>
</head>

<body>
    <h1>Ag-Grid Example</h1>
    <div id="myGrid" style="height: 115px;width:500px" class="ag-fresh"></div>

    <!-- Own Scripts -->
    <script src="{{ asset('js/example.js') }}"></script>
</body>

</html>

Frontend - Jsfile

// specify the columns
var columnDefs = [
    {headerName: "Make", field: "make"}, 
    {headerName: "Model", field: "model"},
    {headerName: "Price", field: "price"}
];

// specify the data
var rowData = [
    {make: "Toyota", model: "Celica", price: 35000},// data has to loaded here
    {make: "Ford", model: "Mondeo", price: 32000},
    {make: "Porsche", model: "Boxter", price: 72000}
];

// let the grid know which columns and what data to use
var gridOptions = {
    columnDefs: columnDefs,
    rowData: rowData,
    onGridReady: function () {
        gridOptions.api.sizeColumnsToFit();
    }
};

// used in our jasmine test
function selectAllRows() {
    gridOptions.api.selectAll();
}

// wait for the document to be loaded, otherwise ag-Grid will not find the div in the document.
document.addEventListener("DOMContentLoaded", function () {
    // lookup the container we want the Grid to use
    var eGridDiv = document.querySelector('#myGrid');

    // create the grid passing in the div to use together with the columns & data we want to use
    new agGrid.Grid(eGridDiv, gridOptions);
});

Any suggestions how to load my data into the var rowData?

Thanks in advance for your replies!

23 Dec
1 year ago

GregorSams started a new conversation Error - Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array

Hello guys,

the following query works perfectly well on my mysql db:

SELECT *
            FROM instruments
            LEFT join financials on instruments.id=financials.instruments_id
            WHERE financials.id IN
            ( SELECT MAX(financials.id)
            FROM financials
            GROUP BY financials.instruments_id )
            ORDER BY instruments.id ASC

I tried to translate the query into eloquent, which looks the following:

$overviewArray = DB::table('instruments')
    ->leftJoin('financials', 'instruments.id', '=', 'financials.instruments_id')
    ->whereIn('financials.id', DB::raw('SELECT MAX(financials.id)
    FROM financials
    GROUP BY financials.instruments_id '))
    ->orderBy('instruments.id')
    ->get()//I get the error here
->toArray(); 

However, I get the following error:

[2017-12-23 15:01:45] local.ERROR: Type error: Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, object given, called in C:\Users\admin\Desktop\Coding Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php on line 250 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Type error: Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, object given, called in C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php on line 250 at C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Grammar.php:135)
[stacktrace]
#0 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php(250): Illuminate\Database\Grammar->parameterize(Object(Illuminate\Database\Query\Expression))
#1 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php(196): Illuminate\Database\Query\Grammars\Grammar->whereIn(Object(Illuminate\Database\Query\Builder), Array)
#2 [internal function]: Illuminate\Database\Query\Grammars\Grammar->Illuminate\Database\Query\Grammars\{closure}(Array, 0)
#3 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Support\Collection.php(847): array_map(Object(Closure), Array, Array)
#4 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php(197): Illuminate\Support\Collection->map(Object(Closure))
#5 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php(180): Illuminate\Database\Query\Grammars\Grammar->compileWheresToArray(Object(Illuminate\Database\Query\Builder))
#6 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php(85): Illuminate\Database\Query\Grammars\Grammar->compileWheres(Object(Illuminate\Database\Query\Builder), Array)
#7 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php(60): Illuminate\Database\Query\Grammars\Grammar->compileComponents(Object(Illuminate\Database\Query\Builder))
#8 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\MySqlGrammar.php(39): Illuminate\Database\Query\Grammars\Grammar->compileSelect(Object(Illuminate\Database\Query\Builder))
#9 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php(1650): Illuminate\Database\Query\Grammars\MySqlGrammar->compileSelect(Object(Illuminate\Database\Query\Builder))
#10 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php(1707): Illuminate\Database\Query\Builder->toSql()
#11 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php(1692): Illuminate\Database\Query\Builder->runSelect()
#12 C:\Users\admin\Desktop\Projects\demo_project\app\Console\Commands\OverviewCommand.php(58): Illuminate\Database\Query\Builder->get()
#13 [internal function]: App\Console\Commands\OverviewCommand->handle()
#14 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(29): call_user_func_array(Array, Array)
#15 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#16 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#17 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Container\Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#18 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Console\Command.php(183): Illuminate\Container\Container->call(Array)
#19 C:\Users\admin\Desktop\Projects\demo_project\vendor\symfony\console\Command\Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#20 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Console\Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#21 C:\Users\admin\Desktop\Projects\demo_project\vendor\symfony\console\Application.php(936): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 C:\Users\admin\Desktop\Projects\demo_project\vendor\symfony\console\Application.php(240): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\OverviewCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 C:\Users\admin\Desktop\Projects\demo_project\vendor\symfony\console\Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Console\Application.php(88): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 C:\Users\admin\Desktop\Projects\demo_project\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(121): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 C:\Users\admin\Desktop\Projects\demo_project\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 {main}
"} 

The error occurs at the ->get() method of my query.

Any suggestions what I am doing wrong?

I appreciate your replies!

22 Dec
1 year ago

GregorSams started a new conversation Laravel 5.5 - UpdateOrCreate() Does Not Add Any Record To Db

I am having the following setup:

SETUP

I am using Laravel 5.5 I have the following db migration:

        Schema::create('prices', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('exchanges_id');
            $table->string('symbol');
            $table->dateTime('exch_datetime');
            $table->decimal('high', 40, 9);
            $table->decimal('low', 40, 9);
            $table->decimal('bid', 40, 9);
            $table->decimal('ask', 40, 9);
            $table->decimal('vwap', 40, 9);
            $table->decimal('open', 40, 9);
            $table->decimal('first', 40, 9);
            $table->decimal('last', 40, 9);
            $table->decimal('change', 40, 9);
            $table->decimal('average', 40, 9);
            $table->decimal('baseVolume', 40, 9);
            $table->decimal('quoteVolume', 40, 9);
            $table->timestamps();
        });

My Model looks like the following:

    class Price extends Model
    {
        protected $fillable = ['exchanges_id', 'symbol', 'exch_datetime', 'high', 'low', 'bid' , 'ask',  'vwap', 'open', 'first', 'last', 'change', 'average', 'baseVolume', 'quoteVolume',];
    }

I am using the cctx library to get price data, see below my minimum viable example command:

    <?php

    namespace App\Console\Commands;

    use App\Price;
    use ccxt\ccxt;
    use Illuminate\Console\Command;
    use Log;

    class TestCommand extends Command
    {

        protected $signature = 'Test:test';

        protected $description = 'Command description';

        public function __construct()
        {
            parent::__construct();
        }

        public function handle()
        {
            $poloniex = new \ccxt\poloniex();
            $this->updatePrices($poloniex, "poloniex");
        }
        public function updatePrices($exchangeObj, $exchangeName)
        {
            $tick = $exchangeObj->fetch_ticker('GAS/BTC');
            var_dump($tick);
            try {
                print_r("#######################" . "\n");
                print_r($tick['datetime'] . "\n");
                print_r($tick['ask'] . "\n");

                $prices = Price::updateOrCreate([
                //    'exchanges_id' => 10,
                    'exch_datetime' => $tick['datetime'],
                ], [
                    'ask' => $tick['ask'],
                ]);
                var_dump($prices->toSql());

            } catch (\Exception $e) {
                Log::info($e->getMessage());
            }
        }
    }       

When I run the command I get the following output:

    >php artisan test:test
    C:\Users\admin\Desktop\Projects\demo_laravel\app\Console\Commands\TestCommand.php:49:
    array(18) {
      'symbol' =>
      string(7) "GAS/BTC"
      'timestamp' =>
      string(13) "1513941757340"
      'datetime' =>
      string(29) "2017-12-22T11:22:37.647+00:00"
      'high' =>
      double(0.00218987)
      'low' =>
      double(0.00155806)
      'bid' =>
      double(0.00174699)
      'ask' =>
      double(0.00176426)
      'vwap' =>
      NULL
      'open' =>
      NULL
      'close' =>
      NULL
      'first' =>
      NULL
      'last' =>
      double(0.0017645)
      'change' =>
      double(-0.14186363)
      'percentage' =>
      NULL
      'average' =>
      NULL
      'baseVolume' =>
      double(52247.01599391)
      'quoteVolume' =>
      double(99.79979936)
      'info' =>
      array(10) {
        'id' =>
        int(198)
        'last' =>
        string(10) "0.00176450"
        'lowestAsk' =>
        string(10) "0.00176426"
        'highestBid' =>
        string(10) "0.00174699"
        'percentChange' =>
        string(11) "-0.14186363"
        'baseVolume' =>
        string(11) "99.79979936"
        'quoteVolume' =>
        string(14) "52247.01599391"
        'isFrozen' =>
        string(1) "0"
        'high24hr' =>
        string(10) "0.00218987"
        'low24hr' =>
        string(10) "0.00155806"
      }
    }
    #######################
    2017-12-22T11:22:37.647+00:00
    0.00176426

Problem

My problem is that nothing gets inserted into the database, when I run the command: enter image description here

Any suggestions why this is the case?

I appreciate your replies!

21 Dec
1 year ago

GregorSams started a new conversation UpdateOrCreate Does Not Insert Anything Within My Db

I am using Laravel 5.5 and would like to insert data in my table. However, laravel does not insert any data in the db:

My table looks like the following:

CREATE TABLE `prices` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `exchanges_id` int(11) NOT NULL,
 `symbol` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
 `ask` decimal(40,9) NOT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

My model has the following fillables:

protected $fillable = ['exchanges_id', 'symbol', 'ask', 'exch_datetime']

My laravel command looks like the following. I am using the cctx lib to get prices:

 <?php

namespace App\Console\Commands;

use App\Prices;
use ccxt\ccxt;
use Illuminate\Console\Command;
use Log;

class TestCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'Test:test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $poloniex = new \ccxt\poloniex();
        $this->updatePrices($poloniex, "poloniex");
    }
    public function updatePrices($exchangeObj, $exchangeName)
    {
        $tick = $exchangeObj->fetch_ticker('GAS/BTC');
        var_dump($tick);
        try {
            print_r("#######################" . "\n");
            print_r($tick['datetime'] . "\n");
            print_r($tick['ask'] . "\n");

            $prices = Prices::updateOrCreate([
            //    'exchanges_id' => 10,
                'exch_datetime' => $tick['datetime'],
            ], [
                'ask' => $tick['ask'],
            ]);
            dd($prices->toSql());

        } catch (\Exception $e) {
            Log::info($e->getMessage());
        }
    }
}

I am getting the following output:

array(18) {
  'symbol' =>
  string(7) "GAS/BTC"
  'timestamp' =>
  string(13) "1513888309387"
  'datetime' =>
  string(29) "2017-12-21T20:31:49.647+00:00"
  'high' =>
  double(0.00219998)
  'low' =>
  double(0.00195)
  'bid' =>
  double(0.00196001)
  'ask' =>
  double(0.00198305)
  'vwap' =>
  NULL
  'open' =>
  NULL
  'close' =>
  NULL
  'first' =>
  NULL
  'last' =>
  double(0.00198328)
  'change' =>
  double(0.00064076)
  'percentage' =>
  NULL
  'average' =>
  NULL
  'baseVolume' =>
  double(48314.74516945)
  'quoteVolume' =>
  double(99.5599155)
  'info' =>
  array(10) {
    'id' =>
    int(198)
    'last' =>
    string(10) "0.00198328"
    'lowestAsk' =>
    string(10) "0.00198305"
    'highestBid' =>
    string(10) "0.00196001"
    'percentChange' =>
    string(10) "0.00064076"
    'baseVolume' =>
    string(11) "99.55991550"
    'quoteVolume' =>
    string(14) "48314.74516945"
    'isFrozen' =>
    string(1) "0"
    'high24hr' =>
    string(10) "0.00219998"
    'low24hr' =>
    string(10) "0.00195000"
  }
}
#######################
2017-12-21T20:31:49.647+00:00
0.00198305

My problem is that nothing gets inserted into the database.

I tried to use dd($prices->toSql()); with my query, but I do not get any sql output.

Any suggestions what might be wrong or how to debug this properly?

I appreciate your replies!

UPDATE I rechecked with your answers, however after trying I still get no record in the db. Because of some changes to my code I created a new question.

20 Dec
1 year ago

GregorSams started a new conversation Wordpress On Subdomain With Laravel As Frontend

I need to add wordpress to an existing laravel app. I am using Apache (XAMPP) to serve the application:

    https://premium.website.com/ -> Wordpress website
    https://website.com/ -> Laravel web application

My folder structure looks like the following, whereas in the \wordpress folder I have all my wordpress files:

enter image description here

My .htaccess looks like the following:

    <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
            Options -MultiViews -Indexes
        </IfModule>
    
        RewriteEngine On
    
        # Handle Authorization Header
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
    
        # Handle Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    </IfModule>

Any suggestions how to setup the development environment to serve the wordpress site from a subdomain?

I also have to say that I currently do not have a specific idea how to approach this problem and appreciate your help !

Thx in advance!

Update

@RamjithAp Thx for your reply! I am currently on a development environment. Any suggestions how to setup the subdomain on my dev env. Please see my updated .htaccess file.

02 Feb
2 years ago

GregorSams started a new conversation Monitor A Website With Laravel

Hey guys,

I am in the process of creating a comment monitoring tool to scan reddit comments for certain keywords.

Under the following url I can display all comments:

https://amp.reddit.com/r/all/comments.json

However I am not sure how to implement the monitoring aspect in laravel. Is php the right language for such requests intensive tasks? Any well designed examples within laravel?

Appreciate your replies!

03 Dec
2 years ago

GregorSams started a new conversation Set Up Database Connection On Cloud9

I am using the following database credentials on my cloud9 terminal(taken from this tutorial):

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=c9
DB_USERNAME=pisco
DB_PASSWORD=

I did the following to select the db:

mysql-ctl cli
use c9;
exit;

Furthermore, I updated my config file in config/database.php:

'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'c9'),
    'username' => env('DB_USERNAME', 'pisco'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => false,
    'engine' => null,
],

Still I get the following error when I run migrate:

pisco:~/workspace $ php artisan migrate

                                                                                                                                                 
  [Illuminate\Database\QueryException]                                                                                                           
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'c9.users' doesn't exist (SQL: alter table `users` add `deleted_at` timestamp null)  
                                                                                                                                                 

                                                                                      
  [PDOException]                                                                      
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'c9.users' doesn't exist  
                                                                                  

Any suggestions what I am doing wrong?