TrentDPT

Experience

29,875

0 Best Reply Awards

  • Member Since 2 Years Ago
  • 274 Lessons Completed
  • 0 Favorites

9th November, 2017

TrentDPT left a reply on Laravel API Consumption In Ionic 2 • 2 weeks ago

Thank you so much for the fast response. Is there anyway i can discuss this further with you to get a better understanding on how to accomplish this?

TrentDPT started a new conversation Laravel API Consumption In Ionic 2 • 2 weeks ago

Hi everyone, I've been following along in the Forums TDD course, and have been using Laravel for a bit now, but still a newbie in the world of web design. I also have been playing around with the Ionic 2 framework in order to develop a possible mobile application.

My question is, how do I best create JSON data with an API from laravel, that I can then tap into with Ionic and display it? I might not be describing this correctly, and I feel I understand the concepts overall, but just havent seen the simplest way of doing this or a good step by step tutorial.

Any and all assistance would be fantastic

17th October, 2017

TrentDPT left a reply on Laravel As A Backend To An APP • 1 month ago

Hi @bashy,

For simplicity lets say I want to make an app that taps into the TDD Forum series by Jeffrey, and it needs all that functionality as well.

How should i go about learning and implimenting this?

TrentDPT started a new conversation Laravel As A Backend To An APP • 1 month ago

Morning All,

I keep hearing the concept of Laravel as a backend to an app, and using API calls or RESTful API calls. I understand the generalized concept that Laravel can be the PHP on the backend of an APP, and that the app (made with either Ionic or Phonegap) then just makes 'calls' to Laravel, but I have no idea how this is done or where to find information that will more easily explain this or walk me through it.

Does anyone know of any tutorials, or can they explain it? Or is it in one of Jeffery's videos, and I just dont know the title?

11th October, 2017

TrentDPT started a new conversation Laravel Backend - Phonegap Frontend Question • 1 month ago

Hi everyone,

So I get the idea that you use Laravel as a backend and create an API, and then that is sent to Phonegap. Then you use Phonegap/HTML/CSS/Jquery/Vuejs to render the data.

However....how the hell do I do that? haha. I would really appreciate if people list out the best resources to figure out how that works? Also, am I going to have to use Vue (or something like Angular) to render what blade would do for me typically for the webapp?

Please shoot me any educational walk throughs or demos that you might know of that could help me learn this.

29th August, 2017

TrentDPT started a new conversation Video Download Speeds • 2 months ago

Hi Jeff,

I've been a long time user, and i typically work offline, so I end up downloading most of the videos. For some reason around the time of video 64 of the TDD Forum series the download speed of the site tanked dramatically. The videos went from 5-8min download to 45-60mins, and they drop often requiring me to hit Resume quite frequently.

I just wanted to bring this to your attention since I have downloading content from other sites at the same pace since this new occurrence

19th July, 2017

TrentDPT left a reply on Laravel 5.4 & Webmail/C-panel • 4 months ago

another thread had the answer for me

TrentDPT left a reply on Laravel 5.4 & Webmail/C-panel • 4 months ago

Developments.

When i use mailtrap with my localhost site it works perfectly. But now when i try to use mailtrap with the cpanel hosted site it has a connection error.

This means that I have some sort of firewall or issue on the cpanel site?

TrentDPT left a reply on Laravel 5.4 & Webmail/C-panel • 4 months ago

So at this point in time if I use the Port:25 then i successfully connect to the c-panel webmail account, and therefore on the browser for my site it tells me that an email has been sent, but nothing ever comes through, and i'm not sure where to trouble shoot in order to find out why it isnt being sent....

TrentDPT left a reply on Laravel 5.4 & Webmail/C-panel • 4 months ago

I go to Mail Client Manual Settings in the C-panel Webmail section, and it has there

Username Password Incoming Server Outgoing Server

I then take the information listed there for Username, Password, and SMTP(outgoing server) & i've placed it in the .env file.

Then i get the above error that was in the original post. Please help

TrentDPT started a new conversation Laravel 5.4 & Webmail/C-panel • 4 months ago

Morning Everyone,

I'm just trying to setup the email so that I can do the simple things like reset password, but keep getting errors.

Swift_TrasportException
Connection to tcp:*****:465 Timed out

Could really use the help on this one. I'm not sure what to do at all

TrentDPT left a reply on Cannot Send Email Using The Given Webmail Configurations On CPanel • 4 months ago

@layer7 What is it that you ended up doing here? I'm in a similar situation just starting out with Webmail on C-panel, and trying to get it to work with Laravel 5.4

17th July, 2017

TrentDPT left a reply on AssertSee When Using Partials • 4 months ago

figured it out, was having a silly issue

TrentDPT started a new conversation AssertSee When Using Partials • 4 months ago

Hit everyone. So i'm trying to design my tests, and I have the following code.

        $this->signIn();

        $region = create('App\Region');

        $reference = create('App\Reference', ['region_id' => $region->id]);

        $this->get('/reference/' . $region->slug)
            ->assertSee($reference->name);

the issue I get is the following "Trying to get property of non-object (C:.....\reference\list.blade.php)

This is because I actually use a partial to display all of the information for the references. How due I then assertSee that content to make sure it is rendering on the page?

12th July, 2017

TrentDPT left a reply on Patch Request To Update User Profile • 4 months ago

Got it. Updated to this...

public function update(Request $request, $id)
    {
        $this->validate(request(), ['job' => 'required']);
        $user = User::where('id', $id)->update([
            'job' => request('job')
        ]);

        return back();
    }

and changed this in form

<form action="/profiles/edit/{{auth()->user()->id}}" method="POST">
        {{csrf_field()}}
        {{method_field('PATCH')}}

TrentDPT started a new conversation Patch Request To Update User Profile • 4 months ago

Having a difficult time understanding how to do a patch request for a user to update his own profile.

There is obviously more to it than this, and need some guidance

public function update(Request $request)
    {
        $user = auth()->user();
        $this->validate(request(), ['job' => 'required']);
        $user->update(request(['job']));

        return back();
    }

11th July, 2017

TrentDPT started a new conversation Chartjs Inside A Boostrap Tab...how To Unhide? • 4 months ago

So apparently what i've read online is that when you have a chartjs element inside a bootstrap tab, that it sets its size to almost nothing, and then when you click on that tab it doesnt appear. I've been trying to read solutions online, but have no idea of how to implement them. Any assistance would be very very very welcomed!

HTML


            <div class="nav-tabs-custom" id="work">
            <!-- Tabs within a box -->
            <ul class="nav nav-tabs pull-right">
              <li class="active"><a href="#revenue-chart" data-toggle="tab">Area</a></li>
              <li><a href="#sales-chart" data-toggle="tab">Donut</a></li>
              <li class="pull-left header"><i class="fa fa-inbox"></i> Sales</li>
            </ul>
            <div class="tab-content no-padding">
            
              <div class="chart tab-pane active" id="revenue-chart" style="position: relative; height: 300px;"></div>
              <div class="chart tab-pane" id="sales-chart" style="position: relative; height: 300px;">
                <canvas id="psfsChart" height="60%"  width="100%"></canvas>
              </div>
            </div>
          </div>

js

$(function () {
var barChartCanvas = $("#psfsChart").get(0).getContext("2d");
    var barChart = new Chart(barChartCanvas);
    var barChartData = {
      labels: [["0-25", "Acute"], ["26-75", "Acute"], ["76-100", "Acute"]],
      datasets: [
        {
          label: "{{auth()->user()->name}}",
          fillColor: "rgba(26, 102, 244, 1)",
          strokeColor: "rgba(210, 214, 222, 1)",
          pointColor: "rgba(210, 214, 222, 1)",
          pointStrokeColor: "#c1c7d1",
          pointHighlightFill: "#fff",
          pointHighlightStroke: "rgba(220,220,220,1)",
          data: [
                {{$user->outcomeStats($region->id, 'psfs', 1)}},
                {{$user->outcomeStats($region->id, 'psfs', 2)}},
                {{$user->outcomeStats($region->id, 'psfs', 3)}}
                // 
          ]
        },
        {
          label: "Avg for Site",
          fillColor: "rgba(247,17,59,1)",
          strokeColor: "rgba(60,141,188,0.8)",
          pointColor: "#3b8bba",
          pointStrokeColor: "rgba(60,141,188,1)",
          pointHighlightFill: "#fff",
          pointHighlightStroke: "rgba(60,141,188,1)",
          data: [
            {{\App\Outcomes::allStat($region->id, 'psfs', 1)}},
            {{\App\Outcomes::allStat($region->id, 'psfs', 2)}},
            {{\App\Outcomes::allStat($region->id, 'psfs', 3)}},
            
          ]
        }
      ],
    };
    barChartData.datasets[1].fillColor = "#00a65a";
    barChartData.datasets[1].strokeColor = "#00a65a";
    barChartData.datasets[1].pointColor = "#00a65a";
    var barChartOptions = {
      //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
      scaleBeginAtZero: true,
      //Boolean - Whether grid lines are shown across the chart
      scaleShowGridLines: true,
      //String - Colour of the grid lines
      scaleGridLineColor: "rgba(0,0,0,.05)",
      //Number - Width of the grid lines
      scaleGridLineWidth: 1,
      //Boolean - Whether to show horizontal lines (except X axis)
      scaleShowHorizontalLines: true,
      //Boolean - Whether to show vertical lines (except Y axis)
      scaleShowVerticalLines: true,
      //Boolean - If there is a stroke on each bar
      barShowStroke: true,
      //Number - Pixel width of the bar stroke
      barStrokeWidth: 2,
      //Number - Spacing between each of the X value sets
      barValueSpacing: 5,
      //Number - Spacing between data sets within X values
      barDatasetSpacing: 1,
      //String - A legend template
      legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
      //Boolean - whether to make the chart responsive
      responsive: true,
      maintainAspectRatio: true,
      scaleOverride: true,
      scaleSteps:5,
      scaleStepWidth:20,
      scaleStartValue:0
    };

    barChartOptions.datasetFill = false;
    barChart.Bar(barChartData, barChartOptions);
});

10th July, 2017

TrentDPT left a reply on Using Hash/md5() Inside Vue? • 4 months ago

figured it out. just put the getGravatarAttribute from User.php into a

protected $appends = ['gravatar'];

then added this to my data in Reply.vue

gravatar: this.data.owner.gravatar

then in computed()

pic(){
    return this.gravatar;

TrentDPT left a reply on Grabbing Email Off Reply • 4 months ago

so i have a function on the user model that does this....

public function getGravatarAttribute()
    {
        $hash = md5($this->email);
        return "http://www.gravatar.com/avatar/$hash";
    }

and its what I use to grab the gravatar outside of a Vue Component. So how can I access either this attribute on the user...or how can I do a

md5(this.data.owner.email) 

in the Vue component to get it to work

TrentDPT started a new conversation Grabbing Email Off Reply • 4 months ago

So i am working through the lesson on Forum with TDD, and there is a portion where you create replies for threads. I want to add a gravatar picture to those replies, and have that in the Vue computed property section. However, I cant figure out how to grab the user's email via the reply in Vue.

data(){
            return {
                body: this.data.body,
                id: this.data.id,
                editing: false
            };
        },
        computed: {
            ago(){
                return moment(this.data.created_at + 'Z').fromNow() + '...';
            },
            signedIn(){
                return window.App.signedIn;
            },

            canUpdate(){
                return this.authorize(user => this.data.user_id == user.id);
                // return this.data.user_id == window.App.user.id;
            },
            pic(){
                return "http://www.gravatar.com/avatar/" + this.email;
            }

so in the pic() computed property i want "this.email" to be the email of the reply owner, so that it will have his/her gravatar next to his/her reply

9th July, 2017

TrentDPT left a reply on Database Migrations Set Limits • 4 months ago

crap, i was wrong, haha

integer|between:X, Y

still requires an integer, you cant leave it blank and allow it to be null :(

TrentDPT left a reply on Database Migrations Set Limits • 4 months ago

got it, figured it out

integer|between: X, Y

TrentDPT left a reply on Database Migrations Set Limits • 4 months ago

Thanks @spekkionu. Appreciate it. i think i'm going to go the validate way. But how can I put in the validation digits_between:X, Y without having a 'required' prior to it? Doesnt seem to be working.

I ask, because I want to leave the option for the user to not put an item in the form, but if they do then it has to be in a range

TrentDPT left a reply on Database Migrations Set Limits • 4 months ago

@bastman69 sorry, yes, @Cronix was correct that I was thinking in terms of setting a range.

So I want to set a range, but I still want it to accept Null as well if someone doesnt enter anything. So for that I can just use what you placed up there...

digits_between:0,10

but then just leave out 'required', correct?

TrentDPT started a new conversation Database Migrations Set Limits • 4 months ago

Morning Group,

if I'm expecting a number/integer to be placed in the database, in the migrations can I set the parameters for what number is acceptable? Meaning <10 , >0?

8th July, 2017

TrentDPT left a reply on Refactoring Help • 4 months ago

@martinbean correct. The field is medical, yes, so I know the variables are oddly named, but in essence i'm just grabbing specific information from a database, averaging it & neglecting the fields left blank, and then posting it on the site. At the same time i'm grabbing total averages so people can compare themselves to the sites mean for a specific type. Main thing for me at this point is what you helped me with in getting the averages was very helpful. but now I'm trying to figure out how to pass it through the Controller so that i'm dealing with a clean code, and one that has a low number of queries for the client side. Which means I'd probably want to figure out how to eager load it well?

7th July, 2017

TrentDPT left a reply on Refactoring Help • 4 months ago

@martinbean - in essence I would like the site to eventually be able to pull the user specific data, and the entire database data so that they can be compared individually against the mean. So i'm setting up methods on a CervicalStats class specifically to calculate that information.

TrentDPT left a reply on Refactoring Help • 4 months ago

excellent, Thanks. I think i like @martinbean 's approach. So now i'm trying to load that data in to the site, and am able to, but dont want to go down the too many Queries route, so trying to figure out best way to eagerload it.

$userStats = [
            CervicalStats::basicCervicalStats('ndi'),
            CervicalStats::basicCervicalStats('psfs'),
            CervicalStats::basicCervicalStats('pcs'),
            CervicalStats::basicCervicalStats('nprs'),
            CervicalStats::basicCervicalStats('days')
        ];

        $allUserStats = [

        ];

        return view('outcomes.index', compact('userStats', 'allUserStats'));

This is how it looks so far, with the website saying

{{$userStats[0]}}

for a specific piece of data. But I dont think this is the best way to do it. This is also without using those other methods you listed, which I think i'd rather do, but trying to figure out how to call it on the site best

TrentDPT started a new conversation Refactoring Help • 4 months ago

I have a lot of duplication in the top 2 methods, but I cant seem to figure out how to refactor down because of the fact that the 2 items I'd pull out are a string & a variable....

public function cervicalNdi()
   {
       return $this->findUserStat()
            ->filter(function($cervicalStat){
                return $cervicalStat->ndi >= 1;
            })
            ->pluck('ndi')
            ->avg();
   }

   public function cervicalPsfs()
   {
       return $this->findUserStat()
            ->filter(function($cervicalStat){
                return $cervicalStat->psfs >= 1;
            })
            ->pluck('psfs')
            ->avg();
   }

   public function findUserStat()
   {
       return CervicalStats::get()->filter(function($cervicalStat){
            return $cervicalStat->user_id == auth()->id();
       });
   }

6th July, 2017

TrentDPT left a reply on How To Query In A Laravel List • 4 months ago

Still unable to get it working thus far. I want to try that method instead of adding in another component. Anyone else could give this newb a bit more of a walk through?

TrentDPT left a reply on Passing Variable Into Page Request • 4 months ago

so i cant do something like... ?

return view('index.' . $something);

how would i set up that array?

TrentDPT started a new conversation Passing Variable Into Page Request • 4 months ago

Is it possible to do something along these lines ..

public function index(Something $something)
{

    return view ('index.($something)');
}

I want to be able to have multiple pages accessed via the same controller, but each page is unique in its own right, so I cant duplicate a lot of the information and have a typical page setup where you just pass a variable into a page using compact.

TrentDPT left a reply on Pass Null To Textarea • 4 months ago

duh, figured it out

TrentDPT started a new conversation Pass Null To Textarea • 4 months ago

Hi everyone,

I'm trying to let my form submit blank spaces to the database. I currently dont have 'required' inside of the input or textarea tags, and I am not validating the information in the store method. But I still get an error. Is this because my DB is not excepting a Null answer? and if so how do i set it so that it does?

TrentDPT left a reply on How To Query In A Laravel List • 4 months ago

So i seem to be running into an error when trying to pass down the information to the child component. I have the Controller sending the variable $references to what is my index.blade.php. That has been turned into an inline-template, and is working with showing the vue.component I wish to implement.

However

<reference-list :data="{{$resouces}}"></reference-list> 

does not seem to pass the information I need to then v-for down to the component. Advice?

5th July, 2017

TrentDPT started a new conversation How To Query In A Laravel List • 4 months ago

I'm sure its simple to do, but I havent found a way yet to create a Vue search box, that will then filter appropriately through a list of items that have come through laravel. In Essence I want to create my own DataTables, but just in a list format. How can I do this?

TrentDPT left a reply on Using ._sortedUniqueBy • 4 months ago

Appreciate it Bobby, but for some reason both of those empty out the Array entirely.

 _.sortedUniqBy

only emptied out the duplicates. This is all modifications Im trying to make to this series https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/47

I'm not sure what I might be doing wrong if your code should be doing the trick...

4th July, 2017

TrentDPT started a new conversation Using ._sortedUniqueBy • 4 months ago

I'm trying to use this to eliminate any duplicates in a notification feed, however it seems to eliminate ALL the items that are duplicates instead of leaving the last for instance. Any advice?

current code

return _.sortedUniqBy(this.notifications, 'link');

TrentDPT left a reply on Notifications In Build Forum TDD Course • 4 months ago

thus far i've tried to use the following

''' return _,sortedUniqBy(this.notifications, 'link'); '''

but thta seems to eliminate ALL duplicates, as opposed to leaving 1 of them

TrentDPT left a reply on Notifications In Build Forum TDD Course • 4 months ago

  1. was super easy, thank you.

  2. is proving more difficult. i cant seem to figure out the if statement for that, since when I look in Vue, there isnt a thread id on the object. There is an id for the notification, but not one that i can pull for the object to set up the if statement. Any advice? How did you write it up?

TrentDPT left a reply on Notifications In Build Forum TDD Course • 4 months ago

Excellent. i'll test it out. So you've gone through that lesson series? Did you do anything about the Queries for the Notifications like he did for the other sections using Baryyvdh\Debugbar?

2nd July, 2017

TrentDPT started a new conversation Notifications In Build Forum TDD Course • 4 months ago

Morning All, So I completed up to lesson 45 in the course where Jeff builds the notification system for the new Threads being posted. Here are my two questions about how to alter this.

  1. How can I set it up that as a user who creates a new Thread you are AUTO subscribed to it and get information about it. (still with option to unsubscribe).

  2. Set it up so that when you get notifications for replies on a Thread that you are just getting 1 notification no matter how many replies have been created since you last visited, and that 1 notification's updated_at just continues to update with each new reply. Currently I dont think a user needs to have 9 notifications for 9 replies on 1 thread, they just need to have 1 notification to go check out that thread.

Thanks all

13th June, 2017

TrentDPT left a reply on Build A Forum - Ep 32 PATCH 405 • 5 months ago

Thanks Maverick, but i just figured it out. I hate that the base URL for the server in xampp is different that in his videos cause i habe to keep making edits to my hrefxs, and apparently there was an error in the axios Reply.vue file. Where i couldnt just say /replies/... But. /Project/public/replies/....

TrentDPT left a reply on Build A Forum - Ep 32 PATCH 405 • 5 months ago

ok, oddly enough it works when i run the site in php artisan serve but when i'm running through my xampp server it isnt working

TrentDPT started a new conversation Build A Forum - Ep 32 PATCH 405 • 5 months ago

Hi everyone,

So i feel like my code is all the same as Jeffrey's for the episode, and i'm getting full green on the testing suite that is built up, however I'm getting a 405 when I try to actually update the replies using Vue & Axios

I'm using Laravel 5.4.23, and i'm not sure what I need to do.

It feels like its an axios issue, but i dont know how I would be able to trouble shoot this.

the error I get is 405 at createError, at Settle, as XMLHttpReuquest.handleLoad.

Any thoughts or guidance would be awesome

25th January, 2017

TrentDPT left a reply on Frontend Vs Backend Question • 9 months ago

in essence what is going to be the best way for me to make a single page application in Laravel? Or at least tap into those sorts of features, where you are pushing with ajax and making things seamless.

Will it be to use Laravel with Vue? with Angular? with just JQuery?

TrentDPT started a new conversation 5.3 With XAMPP • 9 months ago

So quick question. Ive been following along with Jeff, but using XAMPP for my localhost server to run the test sites off of. I notice that when he does an HREF he just has to put the word with a / in front...whereas I either have to type out the entire URL or have to use the url root with the curly brackets around.

Why is this?

TrentDPT started a new conversation Frontend Vs Backend Question • 9 months ago

Evening Everyone,

So i'm fairly new still to coding, and have been working through the Skill tracks that Jeff has on here. I came to the site familiar with HTML & CSS, and then worked through his PHP. Well i'm now up to watching the Vue2 series, and i'm curious...why utilize Vue or Angular? After going through some of the Laravel series like building the Flyer & Building the Forum it seems very hard now to wrap my brain around some of the Vue2 episodes (like the forms one).

I keep reading about the fact that you want Laravel as your Backend, and then you have a Frontend that will connect to it? Why do we want this? Is this for response, and speed? This has to do with the concepts of "single page applications"?

I could just use some help clarifying the why's so that I can finally get started on projects that I want to work on, but need to fully understand what I'm needing in my toolbox

18th August, 2016

TrentDPT started a new conversation Laravel API & Ionic Framework • 1 year ago

I know that previous individuals have brought up this topic..

https://laracasts.com/discuss/channels/general-discussion/ionic-laravel

..but can people explain this to me a bit more? I was hoping to utilize Ionic Framework to create an app, but then use a lot of the tools of Laravel, and structure of Larabook as the backend php. What does this mean for me?

9th January, 2016

TrentDPT left a reply on Laravel 5.2 & Larabook Compatible? • 1 year ago

Has anyone compiled a list that would demonstrate what has actually changed? Ive seen some of the videos that briefly touch on differences, like the auth video for 5.2, but its hard for me to think about the other changes and how they directly effect Larabook. Has anyone compiled that info?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.