rameezisrar

rameezisrar

Member Since 1 Year Ago

Experience Points 41,960
Experience Level 9

3,040 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 363
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

21 May
3 days ago

rameezisrar left a reply on Validate Alphanumeric Parameter On Route Of Api

@mhery createa a custom Validation rule i.e AlphaDash and then use it on the validation

Validator::make($data, [
            'AlphaDash' => [
                'required',
                new AlphaDash
            ]
        ]);

rameezisrar left a reply on Laravel 5.7 + Jasper

What is the error?

rameezisrar left a reply on Redirection Failure On Captcha

I created a custom validation rule to tackle this. Finally, it worked :) @z

20 May
4 days ago

rameezisrar started a new conversation Redirection Failure On Captcha

I am using the laravel registration form. On the RegisterController I am checking the response body. On captcha failure, I am trying to redirect the user to the register page. Pretty simple right? Here is the code

  $response  = Zttp::asFormParams()->post('https://www.google.com/recaptcha/api/siteverify',[
            'secret' => config('services.recaptcha.secret'),
            'response' => $data['g-recaptcha-response'],
            'remoteip' => $_SERVER['REMOTE_ADDR']
        ]);
        
        $response_body = json_decode($response->getBody(), true);
        
        
        if($response_body['success'] == false){ // redirect and abort
    
            
            return redirect()->route('register');
        }

On the captcha failure instead of simpy redirecting, it throws the following error:

Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, instance of Illuminate\Http\RedirectResponse given, called in 

I just want to redirect to the register page

17 May
1 week ago

rameezisrar started a new conversation Laravel Spark Subscription Sucks

Well, the Laravel's Spark subscription checkout page suddenly not working. Sounds generic right? When I try to subscribe a plan, the user created but the subscription isn't created for the user and the page redirects to local.app.name/undefined.

The spark-register-stripe vue component redirects to the Laravel\Spark\Http\Controllers\Auth\Register Controller

<?php

namespace Laravel\Spark\Http\Controllers\Auth;

use Laravel\Spark\Spark;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Laravel\Spark\Events\Auth\UserRegistered;
use Laravel\Spark\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RedirectsUsers;
use Laravel\Spark\Contracts\Interactions\Auth\Register;
use Laravel\Spark\Contracts\Http\Requests\Auth\RegisterRequest;

class RegisterController extends Controller
{
    use RedirectsUsers;

    /**
     * Create a new authentication controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');

        $this->redirectTo = Spark::afterLoginRedirect();
    }

    /**
     * Show the application registration form.
     *
     * @param  Request  $request
     * @return Response
     */
    public function showRegistrationForm(Request $request)
    {
        if (Spark::promotion() && ! $request->filled('coupon')) {
            // If the application is running a site-wide promotion, we will redirect the user
            // to a register URL that contains the promotional coupon ID, which will force
            // all new registrations to use this coupon when creating the subscriptions.
            return redirect($request->fullUrlWithQuery([
                'coupon' => Spark::promotion()
            ]));
        }

        return view('spark::auth.register');
    }

    /**
     * Handle a registration request for the application.
     *
     * @param  RegisterRequest  $request
     * @return Response
     */
    public function register(RegisterRequest $request)
    {
        Auth::login($user = Spark::interact(
            Register::class, [$request]
        ));

        event(new UserRegistered($user));

        return response()->json([
            // 'redirect' => $this->redirectPath()
            'redirect' => '/thankyou'
        ]);
    }
}

How can I hack the subscription? so I can tweak it on my own.

Stripe provides really easy interface for the the subscription.

24 Apr
1 month ago

rameezisrar left a reply on Not Getting The New Error Page After Upgrade

@DEVFREY - I am not actually overriding the error pages. With the upgrade, the system needs to loads these new error svg pages

rameezisrar started a new conversation Not Getting The New Error Page After Upgrade

After migrating to 5.7 and copying the svg files into /public/svg folder, I am getting the same old error page

16 Apr
1 month ago

rameezisrar started a new conversation Vue-tribute Not Updating With New Data

I am using vue-tribute to let user mention other users.

this is my component data

 data(){
            return {
               body: '',
               tributeOptions: {
                   // symbol that starts the lookup
                    trigger: '@',

                    // element to target for @mentions
                    iframe: null,

                    // class added in the flyout menu for active item
                    selectClass: 'highlight',

                    // function called on select that returns the content to insert
                    selectTemplate: function (item) {
                        return '@' + item.original.value;
                    },

                    // template for displaying item in menu
                    menuItemTemplate: function (item) {
                        return item.string;
                    },
                   

                   values: [
                        {key: 'Phil Heartman', value: 'pheartman'},
                        {key: 'Gordon Ramsey', value: 'gramsey'}
                    ]
               }
            };
        },

on mounted I am fetching fresh data from server but I am still getting that old values data of two users.

getUsers(){

                axios.get('/api/users/list')
                .then( response => {
                    
                    this.tributeOptions.values = response.data;
     
                })
                .catch(error => {

                   

                });

            }  
15 Apr
1 month ago

rameezisrar left a reply on Guzzle Response Success On Captcha

@grenadecx Yes it does return the JSON response but I wasn't converting it into an associative array which was resulting in the error I mentioned :) Thanks a bunch :)

rameezisrar started a new conversation Guzzle Response Success On Captcha

$client = new Client();
        $response = $client->request('POST', 'https://www.google.com/recaptcha/api/siteverify',[

            'secret' => config('services.recaptcha.secret'),
            'response' => $request->input('g-recaptcha-response'),
            'remoteip' => $_SERVER['REMOTE_ADDR']

        ]);

     return $response->getBody();

the response is

{ "success": false, "error-codes": [ "missing-input-response", "missing-input-secret" ] }

But I cant just use

i want to get the success field out of it.

01 Apr
1 month ago

rameezisrar left a reply on Disabled Button After Cancelling Return Confirm

replace {{ csrf_field() }} with 'csrf'

29 Mar
1 month ago

rameezisrar left a reply on Limit Entries In Database PHP

@hurairidz $rows = UserInterests::where('user_id', $id)->get(); $wordCount = $rows->count();

28 Mar
1 month ago

rameezisrar left a reply on Limit Entries In Database PHP

@hurairidz You have to verify that on the server side. Before inserting into tables, count the entries entered by a specific user(student_id). If they are less than 30 then create/insert the entry else print a error message

13 Mar
2 months ago

rameezisrar left a reply on How To Combain Two Tables In One Result Algolia

You have stated you have stored the custom attribute then you can switch to backend search if Algolia isn't working for you

08 Mar
2 months ago

rameezisrar left a reply on SPA Vs Multi Page Application

You can have the best of both the worlds. You can go with blade template and you can add Vue components on the blade templates wherever you think will do the best as per user experience

28 Sep
7 months ago

rameezisrar left a reply on Need Guidance For Database Room Rent

what is the relationship between the person and the room? One room only belongs to one person?

rameezisrar started a new conversation Extending Spark Classes

Spark publishes only the view folder under resources so we can change the layout design as per our need but what about the extending the classes? I cannot modify the spark classes under the root/spark/src directory as when I update the spark all the changes will be gone. How can tackle this while upgrading and extending the functionality at the same time

12 Sep
8 months ago

rameezisrar left a reply on With Spark 7, The Resume Subscription Doesnt Update On Stripe

@frankperez87 I have emailed them too from my spark account. But that is odd right

11 Sep
8 months ago

rameezisrar started a new conversation With Spark 7, The Resume Subscription Doesnt Update On Stripe

I upgraded from spark 6 to 7. The resume functionality doesn't resume subscription on the stripe account but only update the database value.

Which in this the stripe won't charge the customer the next month.

30 Aug
8 months ago

rameezisrar started a new conversation Unable To Create Multiple VUE Instances On Laravel Spark

app.js

require('spark-bootstrap');

require('./components/bootstrap');



var app = new Vue({
    mixins: [require('spark')]
});

new Vue({
    el: '#app',

    data: {

        state: 'on'
    }

});
29 Aug
8 months ago

rameezisrar left a reply on Unable To Create Another Vue Instance On App.js

When i try this

require('spark-bootstrap');

require('./components/bootstrap');




var app = new Vue({

    data:{

      message: 'hola'

    },

    mixins: [require('spark')]
});

then the console error resolves but the output is the same. This is what i get in the browser

{{state}}

rameezisrar started a new conversation Unable To Create Another Vue Instance On App.js

On the Spark>resources/assets/js/app.js

require('spark-bootstrap');

require('./components/bootstrap');




var app = new Vue({
    mixins: [require('spark')]
});


new Vue({
  el: '#app',

  data: {

      state: 'on'
  }

});

After compiling i get this console error:

 [vue warn] Cannot find element: #app

I don't understand why it's throwing me this error. That was running just fine on laravel but not spark

02 Aug
9 months ago

rameezisrar left a reply on Probability Of Same UUID

@martinbeanI agreed with you. There is a chance of collision if I compare a portion of UUID. That's why I am appending the ID with the UUID Portion so there will never be any collision.

Actually, I do not want to install another dependency but I will use Hashids on some other project

rameezisrar left a reply on Probability Of Same UUID

@36864 @topvillas @lostdreamer_nl When storing the UUID for each model, i am appending the last ID value from the table with an increment of one.

i.e if the last user model store on the table is with the ID:55

$Id += $id then the $UUID = xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx$Id;

I am increasing the characters but eventually that last UUID portion will never be equal to another UUID's last portion :)

rameezisrar left a reply on Probability Of Same UUID

@lostdreamer_nl @martinbean I cannot print 36 characters long UUID as a registration number on the user certificate. First, it looks terrible that long characters on the certificate and then if somebody wants to see the user profile on my public website then he has to write all those characters, even though I am storing the complete UUID on the database.

rameezisrar left a reply on Private Bitbucket Repository

there is a checkbox available to mark it as private when you create a repository

31 Jul
9 months ago

rameezisrar left a reply on Probability Of Same UUID

@lostdreamer_nl thankyou for the help :)

rameezisrar left a reply on Probability Of Same UUID

@36864 You are right. I am actually storing the complete UUID on the database but for visible part( on user's certificate), there is the probability of the collision.

rameezisrar left a reply on Probability Of Same UUID

@36864 if i print the complete UUID on the user profile and certificate then it takes alot of space on the user certificate too

rameezisrar left a reply on Probability Of Same UUID

@36864 thankyou for mentioning it. Actually, I won't be using the complete UUID characters. What I am doing here is to generate a UUID for a specific user then printing the last section of the UUID on the user profile instead of complete UUID(which is 35 characters) which is why I am using explode function instead to print few characters.

rameezisrar left a reply on Helper Function

Well, you must be displaying the select input once on the frontend layout file and one on admin layout file.

So remove it from frontend layout and insert that on the admin layout file.

rameezisrar left a reply on Probability Of Same UUID

@topvillas lol :) Then I shall consider that it won't happen.

rameezisrar started a new conversation Probability Of Same UUID

Lets say we have aUUID

$uuid = xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

$uuid = explode('-',$uuid);

What is the probability of $uuid[4] occurrence with other $other_uuid[4].

Please note the other i am accessing the last section or the fifth part of the uuid as user registration id.

21 Jul
10 months ago

rameezisrar started a new conversation Laravel Homestead Not Mapping Projects Folder And Throwing An Error

i am using vagrant 2.0.2 and Homestead 7. I went throw official documentation.

when i vagrant up to run homestead, i get this error.

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifdown 'eth1' || true
/sbin/ip addr flush dev 'eth1'
# Remove any previous network modifications from the interfaces file
sed -e '/^#VAGRANT-BEGIN/,$ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces.pre
sed -ne '/^#VAGRANT-END/,$ p' /etc/network/interfaces | tac | sed -e '/^#VAGRANT-END/,$ d' | tac > /tmp/vagrant-network-interfaces.post
cat \
  /tmp/vagrant-network-interfaces.pre \
  /tmp/vagrant-network-entry \
  /tmp/vagrant-network-interfaces.post \
  > /etc/network/interfaces
rm -f /tmp/vagrant-network-interfaces.pre
rm -f /tmp/vagrant-network-entry
rm -f /tmp/vagrant-network-interfaces.post

/sbin/ifup 'eth1'

Stdout from the command:



Stderr from the command:

bash: line 5: /sbin/ifdown: No such file or directory
bash: line 19: /sbin/ifup: No such file or directory

I can ssh too but when 'ls', I don't see any projects folder as defined in Homestead.yaml file

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/code
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/public

databases:
    - homestead

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp








12 Jul
10 months ago

rameezisrar started a new conversation Getting The Actual Visitor IP Address

When i use ip() method

$ip = request()->ip();

i get the server address because of cloudflare and not the actual visitor ip address.

When i do this

$_SERVER["HTTP_CF_CONNECTING_IP"]

i got this error

"Undefined index: HTTP_CF_CONNECTING_IP"

Any help will be much appreciated

09 Jul
10 months ago

rameezisrar left a reply on Using Vue Data In Html Image Source

thankyou @bobbybouwmann :) Your code worked

the following code worked too

<img  :src="'storage/' + plan.picture" />

rameezisrar started a new conversation Using Vue Data In Html Image Source

blade.php file

<div class="d-flex align-items-center">
                                    <i class="radio-select mr-2" @click="selectPlan(plan)"
                                    :class="{'radio-select-selected': isSelected(plan)}"></i>
                                    @{{ plan.name }}  @{{plan.picture}}
                                </div>

Well i am able to echo out the 'plan.picture' name which is being sent by the Server.

But i need to need to use tag to display the image.

if i change my above to insert image tag

<div class="d-flex align-items-center">
                                    <i class="radio-select mr-2" @click="selectPlan(plan)"
                                    :class="{'radio-select-selected': isSelected(plan)}"></i>
                                    @{{ plan.name }}  @{{plan.picture}}

<span><img src="@{{plan.picture}}" /> </span>

                                </div>

the image source becomes

<img src="{{plan.picture}}">
08 Jul
10 months ago

rameezisrar left a reply on Forbidden You Don't Have Permission To Access On This Server.

well it turned out to be permission issue the fix was

sudo chown www-data:www-data -R directory-name
29 Jun
10 months ago

rameezisrar started a new conversation Laravel Spark Not Getting Me Any Plan From The Data Source

I am getting $pid as product id from the URL. dd($products) getting me one 1 specific product as I got from the URL but the plans don't show up. I am only getting the registration form and nothing.

I am not getting any log error or console error.

If i remove the second where clouse i:e

$products = Product::where('publish',1)->get();

then everything works fine. However i need to show one product only

SparkServiceProvider

$pid = session('pid');
Spark::useStripe();
        Spark::collectBillingAddress();
   
        $products = Product::where('publish',1)->where('id',$pid)->get();

foreach ($products as $product) {
            Spark::plan($product->name, $product->plan_id)
            ->price($product->price);
      
        }// foreach ended
28 Jun
10 months ago

rameezisrar started a new conversation No Coupon Section Available

When I do remove the noCardUpFront() from the Service Provider, the Coupon section just go away. I need to show that field to the users

27 Jun
10 months ago

rameezisrar started a new conversation Forbidden You Don't Have Permission To Access On This Server.

I have installed my new laravel project. After installing composer dependencies i am getting this access denied error

Forbidden
You don't have permission to access / on this server.
Apache/2.4.18 (Ubuntu) Server at me.abudo.com Port 80

My other project running just fine on the same server with the same user permissions

Abudo: drwxrwxr-x 15 codeninjas www-data 4096 Jun 27 10:36 public
01 Jun
11 months ago

rameezisrar left a reply on Laravel Send Email Using Local Mail Server

@willvincent does that work on local server too?

29 May
11 months ago

rameezisrar left a reply on Unable To Add A New Field In Users Auth Controller

@Thyrosis @Snapey Well it turned out the issue wasn't in the code. Spark lets us add form fields at a different place at the ServiceProvider Class https://spark.laravel.com/docs/6.0/adding-registration-fields

I followed the instructions and it worked.

rameezisrar started a new conversation Unable To Add A New Field In Users Auth Controller

User.php

protected $fillable = [
        'name',
        'email',
        'username'
    ];

Under APp/Http/Auth/RegisterController

return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'username' => "some dynamic value",
            'password' => Hash::make($data['password']),
        ]);

Well whenever I try to register I get this error

eneral error: 1364 Field 'usernmae' doesn't have a default value (SQL: insert into `users` (`name`, `email`, `password`, `last_read_announcements_at`, `trial_ends_at`, `updated_at`, `created_at`) values (test1, [email protected], yLARACASTS_SNIPPET_PLACEHOLDERzI4IjVfXtUljVBMffwyU.CFNuJJ.GfkVQpVQGhglCa8FvsDmcP2e, 2018-05-29 06:15:48, 2018-05-29 06:15:48, 2018-05-29 06:15:48, 2018-05-29 06:15:48)) {"exception":"[object] (Illuminate\Database\QueryException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field 'username' doesn't have a default value (SQL: insert into `users` (`name`, `email`, `password`, `last_read_announcements_at`, `trial_ends_at`, `updated_at`, `created_at`) values (test1, [email protected], yLARACASTS_SNIPPET_PLACEHOLDERzI4IjVfXtUljVBMffwyU.CFNuJJ.GfkVQpVQGhglCa8FvsDmcP2e, 2018-05-29 06:15:48, 2018-05-29 06:15:48, 2018-05-29 06:15:48, 2018-05-29 06:15:48)) at /home/rameez/jedi15/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field 'usernama' doesn't have a default value at /home/rameez/jedi15/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458)

i have tried assigning a default value in the database as Null but then it always store the NUll value on every register.

I have done that with Laravel a few times but i am unable to do that with Spark. @Cronix

28 May
11 months ago

rameezisrar left a reply on Send Password Reset Link Is Not Working (Expected Response Code 250 But Got Code "530",with Message "530 5.7.1 Authentication Required )

@burlresearch The issue has been fixed, now I am able to see the email on MailTramp but the actual email is not being sent on Gmail account. I am testing that from my local server

rameezisrar left a reply on Send Password Reset Link Is Not Working (Expected Response Code 250 But Got Code "530",with Message "530 5.7.1 Authentication Required )

@burlresearch now the error is gone and I can see the email on MailTrap but I am unable to receive email on my real Gmail account. Am I doing something wrong here?

rameezisrar left a reply on Overriding The Spark Controllers

@martinbean Quantity is something else. What I need is multiple subscriptions for a user as right now Spark allows only one subscription for a user. So I need to alter the Spark Controller