tristanisginger

tristanisginger

Head of Human Computer Technolgies at The Ministry of Interplanetary Research

Member Since 1 Year Ago

Monstralipoidus

Experience Points
1,230
Total
Experience

3,770 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-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
1,230 XP
Dec
14
1 year ago
Activity icon

Started a new conversation Setting Up The Command Line In PHPStorm / Windows / Homestead

Hi

I'd like to setup PHPStorm so that I could use it's terminal for my artisan commands (I currently use cmd.exe) in my Homestead Box.

I can't find any instructions and would appreicate any help.

Thanks

Activity icon

Replied to Phpstorm Command Line Tools And Vagrant / Homestead(SSH)

@longestdrive I am trying to set up the command line for artisan in PHPStorm, can you point me to any instructions? Thanks

Activity icon

Replied to Should A Delete Image Function Go In The Controller Or Model

Thanks @martinbean for clearing that up.

Your assumption that the Post model has an image filename as a column is correct. When the post is deleted or the post's image changed a deleteImage() method is called to remove the files from the server.

It didn't seem logically right to me and I will refactor the code to include an Image model.

Please could you tell me why you'd use a listener to delete the image instead of using a seperate method?

Thanks

Activity icon

Replied to Should A Delete Image Function Go In The Controller Or Model

@martinbean would you mind explaining the logic to me further please. I nearly understand which is when i'm at my most dangerous!

When a $post is destroyed how is an ImageController used to destroy an Image? Do I need an Image model?

I am using intervention/image to create thumbnails of uploaded images but an unsure if that impacts anything.

Activity icon

Started a new conversation Should A Delete Image Function Go In The Controller Or Model

Hi

In an online course I am taking the instructor has put his deleteImage($imagePath) function in the BlogController where it is called, I would have expected it to go in the Post model.

Where should it go?

Activity icon

Started a new conversation Adding A GET Variable To A Redirect Route

In my BlogController after deleting a post I redirect to the index page

return redirect(route('blog.index'))->with('destroyed', 'Kaboom. Your post was destroyed.');

I would like to append ?status=trash to the uri, which I've just realised while writing this I can do using string concatination

return redirect(route('blog.index') . "?status=trash")->with('destroyed', 'Kaboom. Your post was destroyed.');

I'll post this in case somebody else is thick like what I is.

Dec
08
1 year ago
Activity icon

Replied to HTML Forms Vs Laravel-form-builder Vs Forms & HTML

After years of Sublime I've recently started using PHPStorm and live templates thanks to Laracasts. Interestingly the live template example Jeffery uses in How to be a PHPstorm wizard is for a form builder text input!

I found using live templates and a form builder to create a blog post very quick.

I'll build my next form raw as all three answers I've had say avoid!

Activity icon

Replied to Using Javascript To Add Class To Pagination

Much nicer, thanks

Activity icon

Replied to Laravel Migrations Add Default Value To Table

Don't forget the change method if your altering an existing column

$table->string('group')->default('group1')->change();
Activity icon

Started a new conversation HTML Forms Vs Laravel-form-builder Vs Forms & HTML

Hi

I am looking at implementing a form builder and see there are two options available; Laravel Collective and kristijanhusak. What are peoples preferences or should I stick to HTML?

Activity icon

Replied to Where Are You All From?

Monstralipoidus, Planet Zorlert

Activity icon

Started a new conversation Using Javascript To Add Class To Pagination

Hello Everybody,

I need to add two classes to the ul element of a pagination object (no-margin pagination-sm)

I can easily accomplish this with JS however is this the preferred method?

Activity icon

Replied to Nested Categories

You should have a category_id in your users, videos and news tables as a foreign key

set in your migration like so

/**
     * Run the migrations.
     *
     * @return void
     */
public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->integer('category_id')->unsigned();
            $table->foreign('category_id')->references('id')->on('categories')->onDelete('restrict');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropForeign(['category_id']);
            $table->dropColumn('category_id');
        });
    }

And you need to set the relationship in your models


class Category extends Model
{
  
public function users()
    {
        return $this->hasMany(User::class);
    }
class User extends Authenticatable
{
    public function category()
    {
         return $this->belongsTo(Category::class);
    }
Dec
07
1 year ago
Activity icon

Started a new conversation Route Syntax/semantics Opinion

Hi

I'm new to Laravel and am trying to make sure I start with good habits.

When writing routes I'd like to know which method people prefer and if there are what the pros and cons of each way. (Is there another way?)

Route::get('/home', 'Backend\[email protected]')->name('home');
Route::get('/home', [
    'as' => 'home', 
    'uses' => 'Backend\[email protected]'
]);

Thanks