cuartas15

cuartas15

Member Since 1 Month Ago

Experience Points
440
Total
Experience

4,560 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
440 XP
Dec
14
21 hours ago
Activity icon

Started a new Conversation Upgrading From 5.8 To 6.7.2 Made Eloquent Union Function To Cast An Integer To A String

I ugraded my app's laravel version to the latest (among other composer dependencies, including php from 7.1.2 to 7.2) and now union is doing some weird stuff with my data:

    $appointmentList = Appointment::select('id', DB::raw('null as appointment_id'), 'office_id', 'patient_id', 'date', 'time', 'minutes', 'selected_entity', 'available', 'locked', 'active', 'description', DB::raw('1 as isAppointment'))
        ->with('patient')
        ->with('appointmentsEntities')
        ->where('office_id', auth()->user()->office_id)
        ->where('date', $formatDate->toDateString())
        ->where('active', '1');

    $revisionList = Revision::select('id', 'appointment_id', 'office_id', 'patient_id', 'date', 'time', 'minutes', 'selected_entity', 'available', 'locked', 'active', 'description', DB::raw('0 as isAppointment'))
        ->with('patient')
        ->where('office_id', auth()->user()->office_id)
        ->where('date', $formatDate->toDateString())
        ->where('active', '1');

    $appointmentRevisionList = $appointmentList->union($revisionList)
        ->orderBy('time')
        ->get();

        \Log::info($appointmentRevisionList);

    return Response::json([
        'success' => true,
        'data' => $appointmentRevisionList,
    ], 200);
}

note the Log line, that is giving me a string instead of an int in appointment_id (which is a BIGINT on MySql) if I just log this:

\Log::info($revisionList->get());

Now it gives me the correct data type. So basically the combination of union and apparently setting the value to null on $appointmentList is giving me this weird behaviour after I upgraded to laravel 6.7.2. I completely discard the PHP upgrade because my current DO production server is already using PHP 7.3, but it's still using 5.8 for Laravel. This is happening as of right now, on my local environment.

I want to know how to fix this honestly.

Thank you.

Activity icon

Started a new Conversation How To Change The Email Configuration For Laravel Notifications On The Fly?

I'm using Laravel email notifications to send my emails because that's enough for my needs.

Now, I need to use a new email configuration for a specific type of email I pretend to send, so the mailgun config I have on my .env file cannot be used, I've found guides but using mailable directly, I sill wanna keep using notifications for consistency.

This is basically the layout for each type of message I'm sending throughout my application:

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class SmeClientMailContact extends Notification
{
    use Queueable;

    /**
     * Create a notification instance.
     *
     * @param  string  $message
     * @param  string  $email
     * @param  string  $phone
     * @param  string  $contactName
     * @return void
     */
    public function __construct($message, $email, $phone, $contactName)
    {
        $this->message = $message;
        $this->email = $email;
        $this->phone = $phone;
        $this->contactName = $contactName;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->from(config('app.contact_email'), config('app.contact_email_name'))
            ->subject('Su Médico Especialista - Mensaje de contacto de ' . $this->contactName)
            ->greeting('Mensaje de contacto de ' . $this->contactName)
            ->line('Este cliente acaba de enviar un correo de contacto a sumedicoespecialista.')
            ->line('Nombre: ' . $this->contactName)
            ->line('Correo electrónico: ' . $this->email)
            ->line('Teléfono: ' . $this->phone)
            ->line('Mensaje: ' . $this->message);
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}

What's the way to manually set the mail driver, host, port, etc for this notification specifically for example.

Thanks in advance

Dec
03
1 week ago
Activity icon

Replied to Scalability On Demand?

Anyone have a possible answer? I honestly refuse to believe that the only way is setting the load balancers and such from minute 0 because that would be a good waste of money. I of course gave a look to vapor, but it requires laravel 6+ and it costs triple the Most basic plan on forge and double the one that allows multiple sites. Remember I'm making these questions with saving money in mind.

Thanks in advance

Dec
02
1 week ago
Activity icon

Replied to Scalability On Demand?

Uhh, my app is off the mark by 1 version (5.8) and why would I need to switch to Vapor when I can achieve the same with Forge, right?

Activity icon

Started a new Conversation Scalability On Demand?

I've been through multiple tutorials, where the scalability basically begins since the application is first deployed by configuring load balancers and some guides go as far as making a separate server for each individual function (database, redis, application, etc) which is excessive cost wise honestly.

What if I configure a DO server that is simply enough for a year or two, I have everything there, my application, database, Laravel websockets and then when the time comes I need to assign more resources, how do I proceed in that case? would I need to start from zero to decouple my sever into multiple instances each one doing something different or is there a more simpler approach? what if I just need to allocate more storage? are there any good tutorials explaining these situations?

Any help is really appreciated.

Nov
17
3 weeks ago
Activity icon

Replied to Questions About Mass Email With Scheduler

That's an insteresting approach, but I tried that and then I put my site url in APP_URL and yet still the logo isn't showing up, giving me exactly the same html structure when I inspect it

Activity icon

Replied to Questions About Mass Email With Scheduler

Hmm, that's an issue this is what I have:

APP_URL="/"
APP_EXT_URL=""
APP_EXT_URL_LINK="http://mydomain.com/"

The issue is if I put my url on APP_URL it messes with basically almost everything that is out there in the web page that is made to go back to the root page, that's why I added APP_EXT_URL and APP_EXT_URL_LINK, to not mess with these other functions.

Just to put it into context: I use APP_EXT_URL for the action button of all my emails that are not coming from my scheduler like so:

->action('Publicar Valoración', url(config('app.exturl') . route('review.confirm', $this->token, false)))

If I just use APP_URL the action will have a totally incorrect url, basically pointing to localhost

APP_EXT_URL_LINK is specific for the mail sent via scheduler and I have to use it like this:

->action('Visitar perfil del especialista', url(config('app.exturllink') . 'p/' . $this->module_title))

It is also being used for the href in my message's template logo.

So yeah, I don't know what exactly I am doing wrong but for now I came up with these workarounds to get it working in all these different situations

Activity icon

Replied to Questions About Mass Email With Scheduler

Ok so this was actually a mistake from my part, my MAILGUN_DOMAIN and MAILGUN_SECRET were missing in my env file, once I put them with the correct information I finally got emails from the right domain

Activity icon

Replied to Questions About Mass Email With Scheduler

Alright, I'm gonna try that out later, for now I configured a mailgun account and I'm going for the most basic setup for now that is using the smtp config instead of the API or the lib you provided, changed my env file, restarted the server and for some reason my app is still sending emails through my old configuration (meaning old domain vs a new domain name that I used for mailgun specifically).

Do I need to clear some cache or something?

Activity icon

Replied to Questions About Mass Email With Scheduler

Nada, I don't think anything wants to work for me in the foreseeable future, perhaps I will have to live with the fact that only single email is coming without logo

Activity icon

Replied to Questions About Mass Email With Scheduler

hmm, this is weird, Telescope is not giving me any logs about it, I just added this to the blade template, it works in local but not in production

@php
    \Log::info(url('images/sme_logo.png'));
    \Log::info(asset('images/sme_logo.png'));
@endphp
Activity icon

Replied to Questions About Mass Email With Scheduler

Same result unfortunately. Something has to be happening with a mail being sent via scheduler

Activity icon

Replied to Questions About Mass Email With Scheduler

Uhhh... I don't think making a preview will be an easy task because I don't really save any email content and my emails are notifications and not just mailables per se? I can show you what I see in my email though.

Password reset: https://i.gyazo.com/f297d5dfd7548b847972d37ebf3da2d5.png

Appointment notification via scheduler: https://i.gyazo.com/6ff4b30fc463734b07d664d96a96fa25.png

Like I said, all my emails are based on MailMessage from the default Laravel notifications boilerplate

Nov
16
4 weeks ago
Activity icon

Started a new Conversation Questions About Mass Email With Scheduler

I have 2 specific questions about email in production:

  • Since I'm a total novice on this, I finally got to configure a site on Laravel Forge properly, I can send emails via cron job using the php artisan schedule:run, but I've come to realize this won't work by just using Private Email provided by Namecheap as an email service.

The domain I'm using on my site is stored in Namecheap so I thought using and configuring an email there too would be easy and convenient, I paid for the [email protected], created a bunch of aliases and included them in my application to send emails, and it works, but the email service only allows 500 mails per hour.

I'm not looking to send mass emails as marketing or email lists (for now), what my app is doing is: Use a job to retrieve a list of appointments assigned to the next day in order to send a reminder to the clients, so each email is unique because it has an individual client name/appointment date/time and meeting address. What I've been using to achieve this is Laravel notification, the one that comes with it but slightly modified (I just changed the markdown a little bit).

The amount of appointments per day can go up to hundreds of thousands in the future so I need a service that can do that for me without worrying about email limits and blacklisted ips.

Not to mention I'm using the same notification system for password resets, appointment cancelations, contact and other functions.

So I'm looking for something that can cover these needs, I've been looking mailgun, mailchimp, etc but all of these are oriented on Marketing? and like I said I don't really want that for now but something that can allow me to send massive amounts of mails at once and at the same time individual messages as well? maybe since I know nothing about this I think those services aren't for me but they actually are? that's why I need help about it.

  • This question is more related to Laravel, in production, when I send emails with the scheduler, that email isn't coming with a small image logo but just the alt text, when I inspect it, it's sending something with a localhost route for some reason, this is just for this specific case of sending notifications via jobs, if I for example send a password reset email, the image is showing up just fine, is there something I have to do diferently about it?

This is what my blade template looks like:

@component('mail::layout')
    {{-- Header --}}
    @slot('header')
        @component('mail::header', ['url' => config('app.exturllink')])
            <img src='{{ asset('images/sme_logo.png') }}' height='70' alt='{{ config('app.subname') }}'>
        @endcomponent
    @endslot
    {{-- ... --}}
Nov
14
1 month ago
Activity icon

Replied to Either Changing The Meta Or Installing A SSL Certificate Has Broken My Site

So I solved the issue by basically starting almost from zero. Ended up removing the SSL certificate, went to default and then back to my domain name in Meta, removed the repository and re-installed it once again then reran my deployment script with a fresh database and composer/npm packages, before installing the SSL certificate I made sure it was working with http at least, it was so I went with the installation and now it's working. I don't really know how or why but that's what happened.

Activity icon

Replied to Either Changing The Meta Or Installing A SSL Certificate Has Broken My Site

I ran both commands in my project's root folder, didn't get any output and unfortunately that didn't fix it either.

Activity icon

Started a new Conversation Either Changing The Meta Or Installing A SSL Certificate Has Broken My Site

So, following the laracasts videos I changed my default site's meta to my domain and then installed a Let's Encrypt certificate, tried browsing my site and I just get an empty screen and a 500 error in the browser's console. I tried redeploying my aplication since maybe the change in directory was the cause but still nothing.

Checking nginx logs this is the full error stack I'm getting:

https://i.gyazo.com/5326e10a3a6e8caa3954b72f0044a059.png

Any help would be appreciated.

Nov
13
1 month ago
Activity icon

Replied to Laravel-Echo-Server Installation On Forge With SSL Enabled With The Redis Broadcast Driver And Socket.io

I'm testing this guide with http at the moment, I got to the point where I need to create the daemon but I think it's not working for me, I'm getting this message:

https://i.gyazo.com/3122a0d57bfa08fbd4ed9f2e9303c5a9.png

have in mind my site is still the default, maybe that changes something in the paths?

Activity icon

Replied to Can't Install Dependencies Globally

Yes sir, that does the trick, thank you so much

Nov
12
1 month ago
Activity icon

Started a new Conversation Can't Install Dependencies Globally

First of all I'm a total noob on server deployment and anything related so bear with me. Second, I'm not so sure if this is more a Forge or a Digital Ocean issue. I've gotten to the point where my application is deployed, it has it's own domain, the database is fine, composer and npm dependencies are in place, etc. I'm getting to the step of configuring Redis + Socket.io + Laravel Echo Server for broadcasting but it seems I'm not able to install Echo (npm install -g laravel-echo-server) due to missing permissions.

https://i.gyazo.com/2e370242f55a38815252195c206c015b.png

I've tried to change the folder permissions to even 777 but I get to another permission roadblocks down the line.

For the record, npm install (without the -g) is working perfectly to install my project's dependencies

I would appreciate any help on the matter.

Thanks in advance