TerrePorter

TerrePorter

Member Since 5 Years Ago

Experience Points
33,650
Total
Experience

1,350 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
234
Lessons
Completed
Best Reply Awards
20
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 7
33,650 XP
Sep
19
1 month ago
Activity icon

Replied to Laravel 8 - Route Controller Never Loads

no, but that fixed it. Thanks

Activity icon

Started a new Conversation Laravel 8 - Route Controller Never Loads

I have a new install but for some reason the i cant seem to get any other route to function, except the jetstream routes those work.

Route::get('test', function () {
    echo 'test';
});

use App\Http\Controllers\IndexController;
Route::get('test2', [IndexController::class, 'test2']);

both of these return 404 not found.

I have yet to figure out why.

Sep
16
1 month ago
Activity icon

Replied to Add Data To Auth::user()

I think that is what i did. Thanks

Been stuck in wordpress, so forgetting most of my laravel stuff

Activity icon

Started a new Conversation Add Data To Auth::user()

I need to put extra data in the user object after logging in.

Auth::user()->id

Auth::user()->myvar

I did this once before, but I can’t seem to find the project. Can anyone refresh my memory?

Jul
03
3 months ago
Activity icon

Awarded Best Reply on What Am I Doing Wrong? LoadViewsFrom

figured it out, had a type-o in another palace that was overwriting the hints completely.

Activity icon

Replied to What Am I Doing Wrong? LoadViewsFrom

figured it out, had a type-o in another palace that was overwriting the hints completely.

Activity icon

Replied to What Am I Doing Wrong? LoadViewsFrom

any ideas? really at a confused state right now

Jul
02
3 months ago
Activity icon

Replied to What Am I Doing Wrong? LoadViewsFrom

I tried this as well, but it to returns the same error

$this->app['view']->addNamespace('test', $viewsPath);
Activity icon

Replied to What Am I Doing Wrong? LoadViewsFrom

the test.login would be for a directory.template style. Since i am using the package it would be the other.

Activity icon

Started a new Conversation What Am I Doing Wrong? LoadViewsFrom

This doesn't seem to be working as expected from my packages service provider.

 $viewsPath = [
            __DIR__ . "resources/views/themes/one",
            __DIR__ . "resources/views/themes/default",
        ];
        $this->loadViewsFrom($viewsPath, 'test');

on the page i get the following error

View [login] not found. (View: /home/vagrant/Code/_play/test/resources/views/auth/login.blade.php) 

the template only has the following

@extends('test::login')

The service provider is loading but something odd is happening to the namespace path

Any ideas?

Jun
11
4 months ago
Activity icon

Awarded Best Reply on Elequent Pivot Belongs To Many

I seemed to have figured it out, it was something to do with the custom column names in the category_group_categories table.

Activity icon

Replied to Elequent Pivot Belongs To Many

I seemed to have figured it out, it was something to do with the custom column names in the category_group_categories table.

Activity icon

Started a new Conversation Elequent Pivot Belongs To Many

I am only getting on result in the categories response and i cant seem to find any errors. The problem is i only get one result, not four.

IndexController

 // get active campaign
        $campaign = Campaign::where('start_date', '<=', Carbon::now())->where('end_date', '>=', Carbon::now())->first();

$campaign->load('CategoryGroup.Categories');
var_dump($campaign->toArray());

// result
array (size=11)
  'id' => int 5
  'status' => int 4
  'name' => string 'Campaign 1' (length=18)
  'categories_group_id' => int 8
  'businesses_group_id' => int 3
  'start_date' => string '2020-06-01T00:00:00.000000Z' (length=27)
  'end_date' => string '2020-06-13T00:00:00.000000Z' (length=27)
  'created_at' => string '2020-05-04T13:18:10.000000Z' (length=27)
  'updated_at' => string '1999-12-20T08:31:53.000000Z' (length=27)
  'deleted_at' => null
  'category_group' => 
    array (size=3)
      'id' => int 2
      'campaigns_id' => int 5
      'categories' => 
        array (size=1)
          0 => 
            array (size=8)
     		 'id' => int 4
      		'name' => string 'Category A' (length=20)
     		 'type' => string '0' (length=1)
      		'tag' => string 'category_a' (length=19)
	      	'created_at' => string '1974-11-30T19:46:06.000000Z' (length=27)
      		'updated_at' => string '1982-03-21T15:51:34.000000Z' (length=27)
      		'deleted_at' => null
      		'pivot' => 
        		array (size=2)
          			'categories_id' => int 2
          			'category_groups_id' => int 4

Campaign model

 public function CategoryGroup(  )
    {
        return $this->hasOne('App\CategoryGroup', 'campaigns_id', 'id' );
    }

CategoryGroup model

public function Categories()
    {
        return $this->belongsToMany('App\Category', 'category_group_categories', 'categories_id', 'category_groups_id');
    }

Database data

Campaigns


$campaigns = array(
	array(
		"id" => 5,
		"status" => 4,
		"name" => "Campaign 1.",
		"categories_group_id" => 8,
		"businesses_group_id" => 3,
		"start_date" => "2020-06-01 00:00:00",
		"end_date" => "2020-06-13 00:00:00",
		"created_at" => "2020-05-04 13:18:10",
		"updated_at" => "1999-12-20 08:31:53",
		"deleted_at" => NULL,
	),
);

Category Group

$category_groups = array(
	array(
		"id" => 8,
		"campaigns_id" => 4,
	),
);

Categories group categories pivot

$category_group_categories = array(
	array(
		"id" => 2,
		"category_groups_id" => 4,
		"categories_id" => 4, // Category A
	),
	array(
		"id" => 3,
		"category_groups_id" => 4,
		"categories_id" => 7,
	),
	array(
		"id" => 4,
		"category_groups_id" => 4,
		"categories_id" => 2,
	),
	array(
		"id" => 5,
		"category_groups_id" => 4,
		"categories_id" => 6,
	),
);

Any ideas?

May
31
4 months ago
Activity icon

Replied to DataTables And Laravel

oh man, that was the problem i was missing a little s, grr

Activity icon

Replied to DataTables And Laravel

yes it is in a blade template

@section('js')
    <script>

        $(document).ready(function () {

            $('#userList').DataTable({
                'processing': true,
                'serverSide': true,
                'serverMethod': 'get',
                'ajax': {
                    'url': "{{ route('api.getUsers', ['api_token=' => $apiToken ])}}",
                    'dataSrc': "data"
                },
                'columns': [
                    { data: 'user' },
                    { data: 'last_login' },
                    { data: 'ballots_life' },
                    { data: 'ballots_campaigns' },
                    { data: 'buttons' },
                ]
            });


            // Handler for .ready() called.
        });

    </script>
@stop
Activity icon

Replied to DataTables And Laravel

nothing in console

Activity icon

Replied to DataTables And Laravel

Ok, i updated that. I see it was url encoding the link. However, there is still no request from the browser though.

Activity icon

Started a new Conversation DataTables And Laravel

I am trying to set up a DataTable's in Laravel but for some reason it doesn't do the XHR request on the browser.

$('#userList').DataTable({
                'processing': true,
                'serverSide': true,
                'serverMethod': 'get',
                'ajax': {
                    'url': "{{ route('api.getUsers', 'api_token='. $apiToken) }}",
                    'dataSrc': "data"
                },
                'columns': [
                    { data: 'user' },
                    { data: 'last_login' },
                    { data: 'ballots_life' },
                    { data: 'ballots_campaigns' },
                    { data: 'buttons' },
                ]
            });

The api works.

{"draw":1,"recordsTotal":1,"recordsFiltered":1,"data":[{"user":"test","last_login":"today","ballot_life":1,"ballot_campaign":1,"buttons":"buttons"}]}

Anyone have any ideas?

May
17
5 months ago
Activity icon

Replied to How To Remove Public From Laravel 6 Website

@sid0001 I haven't updated this to the new laravel version but I had an issue where i needed to specify custom paths for the app. So this might help, https://github.com/TerrePorter/LaravelFrameworkLoader

edit: This was for this type of file path

hostroot\laravel_app
hostroot\public

I couldnt get the .htaccess to work and i had no access to change the hostroot path.

I just copied what was in the laravel public to the hostroot\public and update the path in the index file.

Activity icon

Replied to Publish Service Provider

@denniseilander I ended up just making a packages folder and loading the code that way. Thanks though

May
14
5 months ago
Activity icon

Started a new Conversation Publish Service Provider

I am starting a new package development but the symlink is not working, so i did mirror but i don't want to develop code in the vendor dir. I was thinking that I could publish everything and update the code there then copy it back to the main package project. I am having a hard time getting the service provider to publish, can someone point my tired brain to the correct code?