MarcosKlender

MarcosKlender

Member Since 1 Year Ago

Experience Points
710
Total
Experience

4,290 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.

Level 1
710 XP
Oct
17
1 month ago
Activity icon

Replied to Scheduling Two Artisan Commands In Production

Welp, I found the solution. As I mencioned, my project is in production mode.

In production, commands like 'db:seed' needs a confirmation, so you must use '--force'.

$schedule->command('db:seed --class=DatabaseSeeder --force')->dailyAt('17:30');
Activity icon

Replied to Scheduling Two Artisan Commands In Production

Whit that command I get the same output:

Running scheduled command: '/usr/bin/php7.1' 'artisan' db:seed --class=ProductionSeeder > '/dev/null' 2>&1

Nothing happened.

Activity icon

Replied to Scheduling Two Artisan Commands In Production

Yes, I tried with 'everyMinute', Five, Ten, and other options but nothing happened.

This is what I get when run the 'schedule:run':

Running scheduled command: '/usr/bin/php7.1' 'artisan' db:seed --class=ProductionSeeder > '/dev/null' 2>&1

But the seeder doesn't start.

Activity icon

Replied to Scheduling Two Artisan Commands In Production

I tried so many times with different options, the schedule actually runs but nothing happened. The seeder doesn't start. I don't know what to do. :(

Activity icon

Replied to Scheduling Two Artisan Commands In Production

When I run the command 'php artisan schedule:run' directly from console it says:

No scheduled commands are ready to run.

What I'm doing wrong?

Activity icon

Started a new Conversation Scheduling Two Artisan Commands In Production

Hi everyone.

I need to run two different artisan commands as Task Scheduling. I just add the crontab line but nothing happened. Can anyone help me, please?

Here's my Kernel.php

<?php

namespace WebServiceApp\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{

    protected $commands = [
        //
    ];

    protected function schedule(Schedule $schedule)
    {
        $schedule->command('db:seed --class=ProductionSeeder')->dailyAt('11:35');
        $schedule->command('db:seed --class=DatabaseSeeder')->dailyAt('12:30');
    }

    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}

And here's my crontab

# Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').# 
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
* * * * * php /home/marcosklender/Documents/Electronic_Documentation/artisan schedule:run >> /dev/null 2>&1

I'm using Laravel 5.5 and it's in production mode.

Sep
11
2 months ago
Activity icon

Replied to From Database (Text) To XML

It gives me an error: XML declaration allowed only at the start of the document.

And when I move the $data to the top, it gives me another error: Document is empty.

Activity icon

Started a new Conversation From Database (Text) To XML

Hi guys,

In my bdd I have a column (text) called "xml_documento" which store a XML in text format. I need to pass them on a view with all the XML structure. Then I want to change that view with CSS.

Here's my CustomerController.php

<?php

namespace WebServiceApp\Http\Controllers;

use Illuminate\Http\Request;
use WebServiceApp\Customer;
use PDF;

class CustomerController extends Controller
{
  public function export_pdf()
  {
    $data = Customer::select('xml_documento')->get();

    return response()->view('test', compact('data'))->header('Content-Type', 'text/xml');

  }
}

And here's my test.blade.php

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    {{ $data }}
</urlset>

I don't have errors when I refresh the page but the content retrieved from database ($data) still remains as text. I need to transform that text to XML too. Please help! :(

Sep
05
2 months ago
Activity icon

Replied to XML To PDF

Can you help me again, please?

I used DomPDF, I read the text field from database and make the XML show in the PDF file but in shows as plain text. Here's my controller:

<?php

namespace WebServiceApp\Http\Controllers;

use Illuminate\Http\Request;
use WebServiceApp\Customer;
use PDF;

class CustomerController extends Controller
{
  public function export_pdf()
  {
    // Fetch all customers from database
    $data = Customer::get();
    // Send data to the view using loadView function of PDF facade
    $pdf = PDF::loadView('test', compact('data'));
    
    $pdf->save(storage_path().'_filename.pdf');

    return $pdf->stream('customers.pdf');
    //return $pdf->download('customers.pdf');
  }
}

And here's my view:

@foreach($data as $customer)
    {{ $customer->xml_documento }}
@endforeach

I need to make that XML to a legible PDF document because it's a bill. :(

Sep
04
2 months ago
Activity icon

Started a new Conversation XML To PDF

Hi guys,

I need to convert a XML to PDF in my Laravel Project (5.5). In PostgreSQL, I have a field called XML_document (text). How can I convert the content of that field into a PDF file?

Any thoughts, comments or tips are welcome.