GregorSams

GregorSams

Member Since 1 Year Ago

Experience Points 450
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

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

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

14 Jan
10 months 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
10 months 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
10 months 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
10 months 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
10 months 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
10 months 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());
        }
    }
}

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!

20 Dec
10 months ago

GregorSams left a reply on Wordpress On Subdomain With Laravel As Frontend

@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.

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

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!

02 Feb
1 year 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
1 year 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?