Thavarshan

Thavarshan

Engineering Student at IESLCE

Member Since 1 Year Ago

Trincomalee, Sri Lanka

Experience Points
56,180
Total
Experience

3,820 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
543
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 12
56,180 XP
30 Jul
1 month ago
22 Jul
1 month ago

Thavarshan left a reply on Laravel Installer Shows Segmentation Fault

Unfortunately no. I havent yet. Im pretty sure it has something to do with composer packages. Well thats what I think.

06 Jul
2 months ago

Thavarshan left a reply on How To Call Object Property As Method?

Brilliant! Thanks again!

Thavarshan left a reply on How To Call Object Property As Method?

Yeah I've been trying to but for my understanding the Laravel code base is really complicated.

I'm basically trying to acheive the fluent routing thing that's being implemented on the Laravel router.

Another instance is in the RouteServiceProvider,

Route::middleware('web')
             ->namespace($this->namespace)
             ->group(base_path('routes/web.php'));

specifically this part,

->namespace($this->namespace)

I don't understand how the namespace is being set through the UrlGenerator and the controller actions are being formatted to incorporate the full namespace.

Thavarshan left a reply on How To Call Object Property As Method?

Do you have any tips on how I can make my own Macroable trait?

Thavarshan left a reply on How To Call Object Property As Method?

Oh thank you so much. I've been searching for this information all over. Thank you!!!

Thavarshan left a reply on How To Call Object Property As Method?

<?php

namespace Illuminate\Routing;


/**
 * @method \Illuminate\Routing\Route get(string $uri, \Closure|array|string|null $action = null)
 * @method \Illuminate\Routing\Route post(string $uri, \Closure|array|string|null $action = null)
 * @method \Illuminate\Routing\Route put(string $uri, \Closure|array|string|null $action = null)
 * @method \Illuminate\Routing\Route delete(string $uri, \Closure|array|string|null $action = null)
 * @method \Illuminate\Routing\Route patch(string $uri, \Closure|array|string|null $action = null)
 * @method \Illuminate\Routing\Route options(string $uri, \Closure|array|string|null $action = null)
 * @method \Illuminate\Routing\Route any(string $uri, \Closure|array|string|null $action = null)
 * @method \Illuminate\Routing\RouteRegistrar as(string $value)
 * @method \Illuminate\Routing\RouteRegistrar domain(string $value)
 * @method \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware)
 * @method \Illuminate\Routing\RouteRegistrar name(string $value)
 * @method \Illuminate\Routing\RouteRegistrar namespace(string $value)
 * @method \Illuminate\Routing\RouteRegistrar prefix(string  $prefix)
 * @method \Illuminate\Routing\RouteRegistrar where(array  $where)
 */
class RouteRegistrar

Thavarshan left a reply on How To Call Object Property As Method?

Ok. Then how does @mixin comment work? Like in the Router Registrar work?

Thavarshan started a new conversation How To Call Object Property As Method?

Is there a way to dynamically call an object property as a method.

For instance.

class ObjA
{
    public $appPath;
}


$objA = new ObjA;

$objA->appPath();
01 Jul
2 months ago

Thavarshan left a reply on Laravel Installer Shows Segmentation Fault

@TRAY2 - Yeah. composer create-project laravel/laravel blog works without an issue.

Thavarshan left a reply on Laravel Installer Shows Segmentation Fault

composer create-project symfony/website-skeleton symfony

yields this

Installing symfony/website-skeleton (v4.3.99)
  - Installing symfony/website-skeleton (v4.3.99): Loading from cache
Created project in symfony
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing symfony/flex (v1.4.1): Loading from cache
[1]    922 segmentation fault  composer create-project symfony/website-skeleton symfony

Thavarshan left a reply on Laravel Installer Shows Segmentation Fault

Perhaps this is an issue with Symfony console?

Thavarshan left a reply on Laravel Installer Shows Segmentation Fault

@SNAPEY - I installed composer a-new on my new machine. The problem still persists.

I tried it again though: You are already using composer version 1.8.6 (stable channel).

Thavarshan left a reply on Laravel Installer Shows Segmentation Fault

@JOHNBRAUN - Well composer require and the rest of the composer commands work on every other packages except for the ones relying on Symfony console.

Thavarshan left a reply on Laravel Installer Shows Segmentation Fault

@EEETM - Yeah, didn't work. Any other suggestions?

30 Jun
2 months ago

Thavarshan started a new conversation Laravel Installer Shows Segmentation Fault

I keep getting the error segmentation fault laravel new blog every time I run the command laravel new blog.

This also happens when I try to install a new Symfony application.

unable to run /usr/local/bin/composer create-project symfony/website-skeleton symfony : signal: segmentation fault

10 Apr
5 months ago

Thavarshan started a new conversation Blade CompilerTest Failing

I've been testing the Laravel frameworks tests specifically the Blade compiler tests just so I can get an understanding of how things work. I'd like to make my own template compiler (Just for the sake of learning).

Four of the tests in the ViewBladeCompilerTest.php file fail and output the following:

Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_0_Illuminate_Filesystem_Filesystem::put('/Users/thavarshan/Codebase/Valet/framework/tests/View/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33.php', 'Hello World'). Either the method was unexpected or its arguments matched no expected argument list for this method


/Users/thavarshan/Codebase/Valet/framework/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php:92
/Users/thavarshan/Codebase/Valet/framework/src/Doktrin/View/Compilers/BladeCompiler.php:126
/Users/thavarshan/Codebase/Valet/framework/tests/View/ViewBladeCompilerTest.php:53
/Users/thavarshan/Codebase/Valet/framework/vendor/phpunit/phpunit/phpunit:61

The test would be:

public function testCompileCompilesFileAndReturnsContents()
{
    $compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);

    $files->shouldReceive('get')->once()->with('foo')->andReturn('Hello World');
    $files->shouldReceive('put')->once()
        ->with(__DIR__ . '/' . sha1('foo') . '.php', "Hello World\n<?php /* foo */ ?>");

    $compiler->compile('foo');
}

Anyone know why and how I can fix it?

I've been fiddling around with the code but haven't changed anything.

30 Mar
5 months ago

Thavarshan left a reply on Checkbox In Laravel

@VISHAAL - I don't mean checkboxes inside the controller. Thats impossible. What I mean is send data through the checkboxes to the controller and let the controller decide what to do.

For instance

if ($request->has('delete'))
{
    // Perform delete

    return $results;
}

//Perform send

return $results;

28 Mar
5 months ago

Thavarshan left a reply on Laravel 5.8 Phpunit Command Issues

@MIKAIL10000000 - Happens to all of us bud. Cheers!

Thavarshan left a reply on Laravel 5.8 Phpunit Command Issues

There is no new way. I suggest you delete the vendor directory and run composer install && composer update again.

Thavarshan left a reply on Checkbox In Laravel

You can do multiple submit with buttons but I don't think you can do the same for check boxes. What you can do instead is let the controller method try and sort this out for you.

21 Feb
7 months ago

Thavarshan left a reply on NGINX Configuration File For Non-Laravel Projects

@MIDWESTDEV - Can you recommend me some tutorials about this please. Having a hard time finding them cause I don't know what to search.

Thavarshan started a new conversation NGINX Configuration File For Non-Laravel Projects

I'm working on a non-laravel project (Building my own custom PHP framework). I'm following another Github repo for this and the repo consists of a nginx-configuration.txt file. I'm running Laravel Valet and since I'm still learning I'm not quite sure where and how and where to add the NGINX config file.

This would be the nginx-configuration.txt file. I have.


# nginx configuration to remove the question mark from the URL but maintain the query string

location / { 
    if (!-f $request_filename){
        set $rule_0 1$rule_0;
    }   
    if (!-d $request_filename){
        set $rule_0 2$rule_0;
    }
    if ($rule_0 = "21"){
        rewrite ^/(.*)$ /index.php? last;
    }   
}

12 Jan
8 months ago

Thavarshan left a reply on Sublime Text 3 Package Control Server Offline

@D9705996 - (Unrelated to this issue) Thank you for replying.

Thavarshan started a new conversation Sublime Text 3 Package Control Server Offline

Everytime I try to install a new package I get

"There are no packages available for installation"

When I check in the console I get

Package Control: Error downloading channel. HTTP error 404 downloading https://packagecontrol.io/channel_v3.json.

Any one else getting this too?

Is https://packagecontrol.io/ down or something?

01 Jan
8 months ago

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@THEMORGZ - Also, Your answer deserves a "Best Answer" vote.

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@THEMORGZ - Hi there!,

Could you please show me what output you get when you run

php --version
31 Dec
8 months ago

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@REALRANDYALLEN How come sequel pro crashes after receiving the error?

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@REALRANDYALLEN - Error: No such keg: /usr/local/Cellar/php The brew unlink php7.3 removed php completely

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@REALRANDYALLEN - yes, Multiple times in fact.

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

Is it weird that after I get the error every time I check the database through Sequel Pro, Sequel Pro crashes?

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@REGAL2157 - I've already done that without any luck.

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

I guess I'll wait till Valet is updated or something.

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@realrandyallen I dont get it. Do you get this error? ErrorException: preg_match(): JIT compilation failed: no more memory

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@REALRANDYALLEN - I get this "Unable to determine linked PHP".

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

I'm sort of at a loss. Laravel Valet always returns "ErrorException: preg_match(): JIT compilation failed: no more memory" everytime a database query has to be made. Nothing I've done seems to fix it.

I've tried reinstalling the whole thing multiple times with no luck.

Thavarshan left a reply on Brew Install PHP 7.2 Instead Of 7.3

@REALRANDYALLEN - Yeah but I sort of need to run brew install php for Laravel Valet you see and PHP 7.3 is problematic.

I’ve already got [email protected] but the PHP 7.3 from brew install php is giving me JIT compiler error no memory problems.

Editing PHP 7.3 ini files didn’t help either. Like turning off pure.jit=0 didn’t solve it.

Thavarshan started a new conversation Brew Install PHP 7.2 Instead Of 7.3

Is there any way to install php 7.2 instead of installing php 7.3 when running brew install php ?

Is there any way to downgrade from php 7.3 to php 7.2 after running brew install php ?

25 Dec
8 months ago

Thavarshan left a reply on Laravel Valet Always Returns "ErrorException: Preg_match(): JIT Compilation Failed: No More Memory"

@D9705996 - So I completely removed [email protected] and guess what?

"preg_match(): JIT compilation failed: no more memory"

I even turned the darn thing off on [email protected]

Thavarshan started a new conversation Laravel Valet Always Returns "ErrorException: Preg_match(): JIT Compilation Failed: No More Memory"

A fresh install of Mac OS and Laravel valet didn't help get rid of the problem. I dug deeper and edited the php.ini files of both PHP 7.2 and 7.3.

edit made on both files was "pecr.jit=1 to pecr.jit=0" still no luck.

19 Dec
9 months ago

Thavarshan started a new conversation Defining Gloabal Variables Through Helper Function Files

Instead of sharing data with all views through the AppServiceProvider is it advisable to register a helper file in composer.json and load global variable to all views through helper functions?

For instance: I need to load a list categories to all my views. But when I load it through my AppServiceProvider and I don't have a database yet I receive an error instead of the view loading up normally and display a message saying "No categories found".

This is to avoid getting an ugly error basically.

13 Dec
9 months ago

Thavarshan left a reply on How Inportant Is Xcode For Us As PHP And Javascript Developers?

@SUSTAINED - So unless you work with compiled native code you won’t need Xcode.

Does Xcode provide any dependencies for npm or composer usage?

If I uninstalled it completely will it effect my development?

Thavarshan started a new conversation How Inportant Is Xcode For Us As PHP And Javascript Developers?

On a scale of 1 to 10, How inportant is Xcode for our Mac dev machines? And will we ever use it in our line of work?

05 Dec
9 months ago

Thavarshan left a reply on Products And Product Attributes Relationship Best Practices

@VAJID - Thanks! I'll try your method as well. No harm in using both.