emfpc

emfpc

Member Since 1 Year Ago

Experience Points
2,310
Total
Experience

2,690 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
2
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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
2,310 XP
Aug
31
3 weeks ago
Activity icon

Started a new Conversation Make The Home (localhost) From A Index Controller

Greetings,

In my current application I have has the home a small form that i get from a simple view:

Route::get('/', function () {
    $md_list = MedicalPlansList::all();
   return view('Form.guestForm', compact('md_list'));
  
});

At the last minute i need to change the home to another page that in order to access it you need to type

localhost/dashboard

I cant simple put return view dashboard since this view is getting data from a controller in the index

Route::resource('dashboard', 'DashboardController')->middleware('auth');

How can i make the dashboard, without typing on the heather localhost/dashboard, as the home without moving / copying everything on the Controller index?

Thank you for your help

Jul
15
2 months ago
Activity icon

Replied to Sending Wordpress Data Form To A Laravel Site Has POST

@snapey When using the console from my web browser i notice that in the json section it gives this error:

message	"SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'mensaje' cannot be null (SQL: insert into `webhooks` (`name`, `email`, `sujeto`, `mensaje`, `updated_at`, `created_at`) values (?, ?, ?, ?, 2020-07-15 21:14:51, 2020-07-15 21:14:51))"

what i did is that i put nullable in the fields and it seems is not getting the data . This is what i am doing to capture and save the data in my controller:

public function store(Request $request)
    {
   
        $webhook = new Webhook();
        $webhook->name = $request->input('name');
        $webhook->email = $request->input('email');
        $webhook->sujeto = $request->input('sujeto');
        $webhook->mensaje = $request->input('mensaje');

        $webhook->save();
       
    }

Am I capturing the data wrong?

Activity icon

Replied to Sending Wordpress Data Form To A Laravel Site Has POST

i add my route like this: 'http://localhost:800/*' and got the 500 error. how do I check the laravel log files?

Activity icon

Replied to Sending Wordpress Data Form To A Laravel Site Has POST

i am getting status 500 Internal Server Error

Activity icon

Replied to Sending Wordpress Data Form To A Laravel Site Has POST

the site is already excluded from the CSRF checking but still get the 419 status

Activity icon

Started a new Conversation Sending Wordpress Data Form To A Laravel Site Has POST

I honestly i am sorry for sending this question here.

Here is the situation:

I need to capture data from a form that is a WordPress site to a web application, made using Laravel, as POST so i can save the data to my database.

For testing purposes i am using web-hook to send the form data and redirect it to my web application as POST but i get a 419 status.

is there away i can do this? or is impossible.

May
26
3 months ago
Activity icon

Replied to How To Pass Auth::user()->id Using View::share('')

I need to check first if the user that is log in has a picture, if he has a picture i must decrypt that photo. my reason is look for a way to not to do the same function in all of the controller to decrypt the photo.

Activity icon

Replied to How To Pass Auth::user()->id Using View::share('')

It does. When i test the same logic in the web route it works and i have use the same parameter, Auth::user()->staff_profile->id, in other views and it works.

Activity icon

Replied to How To Pass Auth::user()->id Using View::share('')

@michaloravec

<?php

namespace App\Providers;

use Illuminate\Support\Facades\Auth;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
//
use App\Activity;
use App\Ticket;
//
use App\StaffProfile;
use Illuminate\Support\Facades\Storage;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(191);

        $activitys = Activity::all()->sortByDesc('created_at')->take(6);
        $table = Ticket::all();
        
        if(Auth::check()){

            $staff = StaffProfile::findOrFail(Auth::user()->staff_profile->id);
        
            if($staff->staff_pictures == null){
                // return view ('layouts.medflixtemplate',compact('staff'));
                View::share('staff');
            }else{
                $getStaffPicture = Storage::get('public/'.$staff->user->name.'/'.$staff->staff_pictures->p_name);
                // return view ('layouts.medflixtemplate',compact('staff', 'getStaffPicture'));
                View::share(compact('staff', 'getStaffPicture'));
            }
        }
        View::share('activitys', $activitys);
        View::share('table', $table);       
    }

}

The variable $staff is not passing and i'm getting this error:

ErrorException thrown with message "Undefined variable: staff (View: C:\xampp\htdocs\medflix\resources\views\layouts\medflixtemplate.blade.php) (View: C:\xampp\htdocs\medflix\resources\views\layouts\medflixtemplate.blade.php)"
Activity icon

Started a new Conversation How To Pass Auth::user()->id Using View::share('')

Greetings, I am using a template in where there are data that are share in all the views. What i want to do is to be able to pass the current user that is login to be able to display the user picture in the template it works if i hard code the id

        $staff = StaffProfile::findOrFail(1);

        if($staff->staff_pictures == null)
            View::share('staff', $staff);
        }else{
            $getStaffPicture = Storage::get('public/'.$staff->user->name.'/'.$staff->staff_pictures->p_name);
            View::share(compact('staff', 'getStaffPicture'));
        }

i thought in using Auth::user()->id

$staff = StaffProfile::findOrFail(Auth::user()->id)

but i get this error

 ErrorException (E_NOTICE)
Trying to get property 'id' of non-object

Thanks for the help in advance

Activity icon

Awarded Best Reply on Calling Fonts Using Laravel Mix

Found the issue 😊

Activity icon

Replied to Calling Fonts Using Laravel Mix

Found the issue 😊

May
12
4 months ago
Activity icon

Started a new Conversation Calling Fonts Using Laravel Mix

My web application uses font's that are in a folder located in the resources dir. Bootstrap and Javascripts are in the same resource dir and works good in laravel mix but i get errors when it tries to display the font of the theme.

Laravel Mix:

mix.styles(
    [
        "resources/asset/vendor/bootstrap/css/bootstrap.min.css",
        "resources/asset/libs/css/style.css",
        "resources/asset/vendor/fonts/fontawesome/css/fontawesome-all.css",
        "resources/asset/vendor/fonts/circular-std/style.css"
    ],
    "public/css/style.css"
);

Error in inspector:

downloadable font: download failed (font-family: "Circular Std Book" style:normal weight:400 stretch:100 src index:1): status=2147746065 source: http://localhost:8000/css/CircularStd-Book.woff

And this is the style.css of the fonts:

/* #### Generated By: http://www.cufonfonts.com #### */

@font-face {
    font-family: "Circular Std Black";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Black"),
        url("CircularStd-Black.woff") format("woff");
}

@font-face {
    font-family: "Circular Std Book";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Book"), url("CircularStd-Book.woff") format("woff");
}

@font-face {
    font-family: "Circular Std Medium";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Medium"),
        url("CircularStd-Medium.woff") format("woff");
}

@font-face {
    font-family: "Circular Std Black Italic";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Black Italic"),
        url("CircularStd-BlackItalic.woff") format("woff");
}

@font-face {
    font-family: "Circular Std Bold";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Bold"), url("CircularStd-Bold.woff") format("woff");
}

@font-face {
    font-family: "Circular Std Bold Italic";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Bold Italic"),
        url("CircularStd-BoldItalic.woff") format("woff");
}

@font-face {
    font-family: "Circular Std Book Italic";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Book Italic"),
        url("CircularStd-BookItalic.woff") format("woff");
}

@font-face {
    font-family: "Circular Std Medium Italic";
    font-style: normal;
    font-weight: normal;
    src: local("Circular Std Medium Italic"),
        url("CircularStd-MediumItalic.woff") format("woff");
}

thanks in advance

Apr
27
4 months ago
Activity icon

Started a new Conversation Send Data From Index

I'm a little stuck Got a little table that shows ticket information; here is where i got stuck. Each ticket has a icon near the name so that the admin can hit follow to see the progress of each ticket; the follow feature is in the index page where i show all the user data:

<table class="table mydatatable" id="myTable">
                                              <thead class="bg-light">
                                                <tr class="border-0">
                                                  <th class="border-0">Follow</th>
                                                  <th class="border-0"> # </th>
                                                  <th class="border-0">Paciente</th>
                                                  <th class="border-0">
                                                      Plan Medico
                                                  </th>
                                                  <th class="border-0">
                                                      Status
                                                  </th>
                                                  <th class="border-0">Actividad más reciente</th>
                                                  <th class="border-0">Fecha de solicitud</th>
                                                  <th class="border-0">
                                                      
                                                      Asignado
                                                  </th>
                                                </tr>
                                              </thead>
                                              <tbody>
                                                @foreach ( $tickets as $ticket )
                                                  <tr>
                                                    <td>
                                                      
                                                      @if (Auth::user()->following->contains('ticket_id',$ticket->id))
                                                        <a role="button" class="btn btn-link btn-lg" href="javascript:unfollowTicketFunction()">
                                                          <span style="color:#f6e58d;">
                                                          <i class="fas fa-star"></i>
                                                          <input type="text" id="inputTD" value="tickets/{{ $ticket->id }}" >
                                                        </a>
                                                       Following
                                                      @elseif(Auth::user()->name == $ticket->assigned_user)
                                                        <span style="color:#f6e58d">
                                                          <i class="fas fa-star"></i>
                                                        </span>
                                                      @else
                                                        <input type="text" id="inputT" value="tickets/{{ $ticket->id }}" onclick="followTicketFunction()">
                                                       
                                                          <span style="color:#f6e58d;">
                                                            <i class="far fa-star"></i>
                                                          </span>
                                                        <p onclick="followTicketFunction()">Follow</p>
                                                                                                               
                                                      @endif
                                                      {{--    --}}
                                                    </td>
                                                    <td> 
                                                        <a href="tickets/{{ $ticket->id }}">{{ $ticket->ticket_number }}</a>
                                                    </td>
                                                    <td>{{ $ticket->userprofile->user->name }}</td>
                                                    <td>{{ $ticket->userprofile->user->medical_plan->first()->plan_name }}</td>
                                                    <td>
                                                        {{ $ticket->status }}
                                                    </td>
                                                    <td>{{$ticket->activities->first()->description}}</td>
                                                    <td>{{ $ticket->created_at }}</td>
                                                    <td>{{ $ticket->assigned_user}}</td>
                                                  </tr>
                                                @endforeach
                                              </tbody>
                                                <tfoot>
                                                  <tr class="border-0">
                                                    <th class="border-0">Favoritos</th>
                                                    <th class="border-0"> # </th>
                                                    <th class="border-0">Paciente</th>
                                                    <th class="border-0">
                                                        Plan Medico
                                                    </th>
                                                    <th class="border-0">
                                                        Status
                                                    </th>
                                                    <th class="border-0">Actividad más reciente</th>
                                                    <th class="border-0">Fecha de solicitud</th>
                                                    <th class="border-0">
                                                        Asignado
                                                    </th>
                                                  </tr>
                                                </tfoot>
                                            </table>

currently i am tryint to use javascript to send the data into the form:

<form method="post" action="" id="myFollowTicketForm">
    <input type="hidden" name="_method" value="PUT">
    {{ csrf_field()}}

    <input type="text" value="20" name="action" id="action" hidden>
    </form>

if i put in the action on the form where i am sending the data manually it works but can't see to find a way to just click the ticket and send it. is there a better practice for this?

all of my controller are the following

Route::resource('tickets', 'TicketController');

my apologies for the confusion thanks in advance