hardsshah

hardsshah

Member Since 4 Years Ago

Experience Points 16,020
Experience Level 4

3,980 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 226
Lessons
Completed
Best Reply Awards 0
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.

19 Dec
1 year ago

hardsshah started a new conversation Socket IO-BroadCasting-Nginx

Hello Team,

I am using socket io, redis and broadcasting in my laravel project and it works in my local system (ubuntu 16.04, php 7.1+, apache2)

socket.js file file contain

var server = require('http').Server();

var io = require('socket.io')(server);

var Redis = require('ioredis'); var redis = new Redis;

redis.subscribe('task-timer-changed');

redis.on('message',function(channel,message) { message = JSON.parse(message); console.log(channel, message.data.eventData.data); // console.log("Message Received"); //console.log(channel,message);

io.emit(channel + ':' + message.event,message.data.eventData.data); // test-channel:UserSignedUp

});

MyTask.js var socket = io(':3000')

Above things work perfectly on my local system. But the same things is not working on live server (Forge, nginx, php7.1)

It throws "http://mywebsite.com/socket.io/?EIO=3&transport=polling&t=M1kpIxw"

shows status failed.

Please let me know if any other configuration is required.

Thanks.

30 Nov
2 years ago

hardsshah left a reply on Progressive Web Apps

May be you can checkout this basic example https://github.com/surrealsnark/vue-simple-pwa

15 Sep
3 years ago

hardsshah left a reply on Laravel Spark

is anyone else getting Method [callCustomValidator] does not exist. while registering?

10 Sep
3 years ago

hardsshah left a reply on Share Your Custom Elixir Gulpfile.js

@pryley are you using any theme package for your laravel? Sorry for irrelevant question in response to ur question :) but I am looking for a proper theme package at the moment.

01 Sep
3 years ago

hardsshah left a reply on Laravel 5.1.11 Brings Us Authorization! (User Permissions / Access Control)

laravel 5.11 authorization! is it role based? Does this mean I can get rid of third-party packages like entrust completely?

14 Aug
3 years ago

hardsshah left a reply on Want To Reduce Dependancy

Hi Guys! Any suggestions please?

12 Aug
3 years ago

hardsshah started a new conversation Want To Reduce Dependancy

Hi All, I am working on a project which has multiple modules. Like module for blogs, images, news, notice etc. Now each module is independent but it is somewhere associated with the main Auth module which manages users. So now I have to add user_id field to each table for the particular module, e.g posts table of blog will contain user_id field, news table will contain user_id field etc... which will relate to id field of users table. In turn I am repeating task of adding this field to each module's main model entity.

Is there any way/package like commendable traits with which I can eliminate this task? or is there any design pattern to follow for this?

Thanks for any help

31 Jul
3 years ago

hardsshah left a reply on Polymorphic Relations

@milroy thanks, from the code it seems it should serve the purpose, I will try this today and update the discussion.

30 Jul
3 years ago

hardsshah left a reply on Polymorphic Relations

@phildawson the problem is : The roles are dynamic, it can be varying and added new roles in future. Also apart from roles, the features are adding dynamically, right now its just posts and documents but in near future Pages, Links, images, videos will be added, and after that what will be added that will depend on customer requirements, so want to make this as independent as possible. The modules added won't depend directly on User table, and also, if I keep on adding new joining tables with each new feature, the DB will grow badly with time. So I decided to make such package like commentable traits, with polymorphic relations.

Thanks, Hardik

hardsshah started a new conversation Polymorphic Relations

Hi, I am trying to write a package,

https://packagist.org/packages/sunshine/laravel-userable

What I want to achieve is: any eloquent model object can be assigned a user with it. and any eloquent model can be assigned to multiple users.

For eg. a Post belongs to user 1(owner) and user2(contributor) a document belongs to user 2(owner) and user3(editor)

The way I decided to manage these is through following table structure:

| id | userable_type | userable_id | user_id | role | |----|---------------------|-------------|---------|-------------| | 1 | App/Models/Post | 1 | 1 | owner | | 2 | App/Models/Post | 1 | 2 | contributor | | 3 | App/Models/Document | 4 | 2 | owner | | 4 | App/Models/Document | 4 | 3 | editor | |----|---------------------|-------------|---------|-------------|

Now with the package I am able to attach, detach or change role of the user but, If I want to get all the user's details associated with the object how can I get it? What relation and/or function should I add to the package model or trait?

What I want to achieve: Post::find(1)->attachedUsers(); should give me, User details(name,usrname,etc...) of user 1 and 2 Document::find(4)->attachedUsers(); should give me, User details(name,usrname,etc...) of user 2 and 3

Please help me achieve this, or you can even directly contribute to the package.

Thanks

09 Mar
4 years ago

hardsshah started a new conversation Frozen Node Administrator Config

I am facing one issue, and couldn't find anywhere on document that how to handle this.

I have a 'users' table and 'persons' table, 'users' have all basic information and 'person' table have detailed information of user.

the 'users' table has one 'person_id' field which points to id of 'persons' table. now in my User.php model i have a relationship defined as follows

    public function details(){
         return $this->belongsTo('App\Person','person_id');
    }

i want to have combined edit fields in Admin side. so i have created file users.php for Administrator which has following 'edit_field' settings

             'edit_fields' => array(
            'username' => array(
                'title' => 'Username',
                'type' => 'text',
            ),
            'email' => array(
                'title' => 'Email',
                'type' => 'text',
            ),
            'details' => array(
                'title' => "First Name",
                'type'       => 'relationship',
                'name_field' => 'first_name',
            ),
            'is_confirmed' => array(
                'title' => "Is Validated",
                'is_confirmed' => 'username',
                'type' => 'bool'
            )
        ),

there are 2 problems I am facing.

  1. the first name field comes as select box where I want a text box
  2. I want to add last name editable field too. But can't get how can I add that. It would be great help if i can get some solution.
02 Mar
4 years ago

hardsshah left a reply on TestDummy Error

aah that worked, it was a silly mistake . Thanks @RachidLaasri

hardsshah started a new conversation TestDummy Error

https://github.com/laracasts/TestDummy/issues/69 I am trying to load the basic testdummy as follows

and my tests/factories/users.php file is as follows:

$faker->firstName, 'last_name' => $faker->lastName, 'email' => $faker->unique()->email, 'password' => $faker->password, 'gender' => $faker->randomElement(['Male', 'Female']), 'activated' => $faker->boolean ]);

but when i run, it gives me error The User model was not found.

does anyone knows what this is?

16 Feb
4 years ago

hardsshah left a reply on Why There Is No Model Directory In Laravel5

@JeffreyWay one of the concern is, if Taylor has removed directory, there might be some reason, i just wanted to be pretty sure that if he has removed it for a reason then i wouldn't like to add it back :)

hardsshah left a reply on Why There Is No Model Directory In Laravel5

Thanks for the answers! it was really helpful... is there any way i don't have to use full class names? eg, App/models/drivers:: ?

hardsshah started a new conversation Why There Is No Model Directory In Laravel5

Hi All, I was wondering why Taylor has removed the model directory from Laravel 5 and moved the models directly to app directory? Also is there any way i can move the models to a directory for my app, as i just like to tidy it up a bit.

14 Feb
4 years ago

hardsshah left a reply on Roles And Permissions In Laravel 5

Hi @starptech thanks for the response, i will take a look into sentry. and @hostianer just wanted to confirm that all the package of cartalyst seem to be paid. I want to implement free packages. thanks for the reply :)

08 Feb
4 years ago

hardsshah started a new conversation Roles And Permissions In Laravel 5

Hi All, In my previous project with laravel4, i have used Confide and Entrust for my users registration and ACL. But as with release of Laravel5, it by default have user registration process... Should i still use confide and entrust combo with L5 or is there any alternative approach to it?

Thanks for the help. Hardik

20 Dec
4 years ago

hardsshah started a new conversation Argument Based Function Calling.

Hi, I am writing a function which has lots of optional arguments, for now its like this $image = new Image(); if(isset($grey) && $grey=='yes'){ $image->doSomethingGrey(); } if(isset($blur)){ $image->blur(); } if(isset($params['sharpen'])){ $image->sharpen(); } if(isset($params['pixelate'])){ $image->pixelate(); } if(isset($params['invert']) && $params['invert']=='yes'){ $image->invert(); } return $image;

this works fine but I feel that this can be written a bit better without so many if/else Can anyone suggest me idea.

Thanks

16 Dec
4 years ago

hardsshah left a reply on How Can I Use Laravel 4 Packages For Laravel 5?

@MThomas for now, i have started this project in L5 as the delivery date is flexible, but they want it on latest framework. Customer is aware about the scenario

hardsshah left a reply on How Can I Use Laravel 4 Packages For Laravel 5?

@austenc @RachidLaasri @MThomas thanks for the answer. I will check with packages what i can do, just digging into bit of their code :)

hardsshah left a reply on How Can I Use Laravel 4 Packages For Laravel 5?

Thanks very much for the information @bart

15 Dec
4 years ago

hardsshah started a new conversation How Can I Use Laravel 4 Packages For Laravel 5?

I am working on a project with laravel 5. I wanted to use few packages from https://github.com/rtconner and https://github.com/FbF Can I use them directly? or do i need to make any changes?

hardsshah started a new conversation How Can I Use Laravel 4 Packages For Laravel 5?

I am working on a project with laravel 5. I wanted to use few packages from https://github.com/rtconner and https://github.com/FbF Can I use them directly? or do i need to make any changes?