rameezisrar

rameezisrar

Member Since 1 Year Ago

Experience Points 58,650
Experience Level 12

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 467
Lessons
Completed
Best Reply Awards 10
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.

03 Sep
1 week ago

rameezisrar left a reply on Toggles

@sarahs74 If you are only passing a single value i.e the id then you can pass it as a query string to a get request as a wild card variable.

<button class="btn btn-sm btn-primary" name="own" a href="/books/action?action=own">Own It</button>

<button class="btn btn-sm btn-primary" name="wish" href="/books/action?action=wish">Wishlist</button>

IF you are passing more information, then you can use form for each button

rameezisrar left a reply on Vue With Laravel

what is the output on your console? @gathuku

31 Aug
2 weeks ago

rameezisrar left a reply on Informal Poll: Routes File

@snapey lol. thanks man for letting me know. I didn't saw the age of this poll :)

rameezisrar left a reply on Laracasts Refresh

Amazing work nigga. You nailed it.

rameezisrar left a reply on Validation In Laravel

@hayatomn

months later you won't be able to understand your this code

rameezisrar left a reply on Why Phpunit Returns Null If Column Not Exist

@untymage

if (Schema::hasColumn('thread', 'DummyColumn'));
{
    dd('column exist');
}

rameezisrar left a reply on Blocking Users

@ You can set a field in the user's table i.e block(boolean) or status(boolean) And the admin can change the status of any user.

30 Aug
2 weeks ago

rameezisrar left a reply on Informal Poll: Routes File

Please keep the file

29 Aug
2 weeks ago

rameezisrar left a reply on Cannot Create New Project In Homestead

@knot22

as the doc says

init.bat

Once you have cloned the Homestead repository, run the bash init.sh command from the Homestead directory to create the Homestead.yaml configuration file. The Homestead.yaml file will be placed in the Homestead directory:

28 Aug
2 weeks ago

rameezisrar left a reply on Validation In Laravel

@hayatomn you are complicating things

What you should do is add two select boxes(one for hours and other is for minutes) with options fields.

and then on your controller/logic validate this

$validatedData = $request->validate([
        'hours' => 'required',
        'minutes' => 'required',
    ]);

rameezisrar left a reply on Can Not Load File App.css

@trandung can you show your code?

27 Aug
2 weeks ago

rameezisrar left a reply on Can Not Load File App.css

@trandung How are you loading/including the file?

rameezisrar left a reply on Cannot Create New Project In Homestead

@knot22 the code directory should not be in Homestead directory. It could be anywhere i.e in the Documents folder or anywhere

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

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

make sure you run this command while you are in the Homestead directory

init.bat

rameezisrar left a reply on Access-Control-Allow-Origin On Storage For Get Method For Files

@ You need to create a symbolic link via running the command

php artisan storage:link

as per the laravel documentation

The public disk is intended for files that are going to be publicly accessible. By default, the public disk uses the local driver and stores these files in storage/app/public. To make them accessible from the web, you should create a symbolic link from public/storage to storage/app/public. This convention will keep your publicly accessible files in one directory that can be easily shared across deployments when using zero down-time deployment systems like Envoyer.

26 Aug
2 weeks ago

rameezisrar left a reply on Laravel To Mobile Application

@prospeak Follow this link to create your api's. https://lumen.laravel.com/

And then call your APIs from the mobile app framework.

With each registered user either through an app or a web app, a token will be generated and of course you need to use that token when calling the apis

rameezisrar left a reply on Is There A Way To Hold The Data First Before Storing Them To Database?

@chron

For this sort of scenario, I will be using Redis to store the information before inserting into the database

rameezisrar left a reply on Access-Control-Allow-Origin On Storage For Get Method For Files

@secretsseeker You haven't added CORS on the server-side.

Follow this article and you will be good to go

https://medium.com/@petehouston/allow-cors-in-laravel-2b574c51d0c1

25 Aug
3 weeks ago

rameezisrar left a reply on Laravel To Mobile Application

@prospeak As you said you can create a mobile application in ionic or with any other framework. If you have set up the API with token protected and call these services from your mobile app

21 Aug
3 weeks ago

rameezisrar left a reply on Remove From Session

@david001 1) After removing the product from the session you need to get a fresh copy of session products to re-render them.

  1. Or you get the session products and store that in the data. Add/remove the products on the user product action and later send the axios post request with the data
20 Aug
3 weeks ago

rameezisrar left a reply on What Is The Best Way To Manage An Unregistered Visitor Rating System? Token? IP?

@romainb Keep it simple. Store rating based on IP Address only

rameezisrar left a reply on Mixed Content: The Content Must Be Served Over Https

@cronix

 axios.post('//sitename/api/training/section/submit', {
                    fields: this.fields,
                    product: this.product,
                    quiz: this.quiz
                })
19 Aug
3 weeks ago

rameezisrar left a reply on Mixed Content: The Content Must Be Served Over Https

@cronix I have tried that too with https on axios.post but I am still getting the same error

rameezisrar left a reply on What Is The Best Way To Manage An Unregistered Visitor Rating System? Token? IP?

@romainb Token is associated with a registered user. For your current scenario, storing the IP Address will do the trick.

rameezisrar started a new conversation Mixed Content: The Content Must Be Served Over Https

error

Mixed Content: The page at 'https://site/home#/training/17/100' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://site/api/training/section/submit'. This request has been blocked; the content must be served over HTTPS.

AppServiceProvider

use Illuminate\Support\Facades\URL;

class AppServiceProvider extends ServiceProvider
{
    
    public function boot()
    {
       
        if (App::environment('production', 'local'))
        { 
           
       
            URL::forceScheme('https');
          
        }   

        // make forumChannels available with every view
        view()->share('channels', Channels::get());
    }

and I am posting from the vue form

submit() {
                this.errors = {};
                axios.post('/api/training/section/submit/', {
                    fields: this.fields,
                    product: this.product,
                    quiz: this.quiz
                })

though this code working fine perfectly on my local but through a mixed content https error on Production

07 Aug
1 month ago

rameezisrar left a reply on Modifying Spark's Login To Use Username Instead Of Email

@clat23 I am supposing that you are having a username field under the Users table

your User.php

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

Secondly change the input type field from 'email' to 'text' from the login.blade.php

<input id="email" type="text" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required autofocus>

your LoginController

protected function credentials(Request $request)
    {
        $field = $this->field($request);

        return [
            $field => $request->get($this->username()),
            'password' => $request->get('password'),
        ];
    }

public function field(Request $request)
    {
        $email = $this->username();

        return filter_var($request->get($email), FILTER_VALIDATE_EMAIL) ? $email : 'username';
    }


protected function validateLogin(Request $request)
    {
        $field = $this->field($request);

        $messages = ["{$this->username()}.exists" => 'The account you are trying to login is not registered or it has been disabled.'];

        $this->validate($request, [
            $this->username() => "required|exists:users,{$field}",
            'password' => 'required',
        ], $messages);
    }


06 Aug
1 month ago

rameezisrar left a reply on Checking For Null Values In A User Object

@elo

@if($user->sex)
    not null
@endif

equals to

if($user->sex){
    not null
}
05 Aug
1 month ago

rameezisrar left a reply on Vue Emit From Slot To Parent

Attach a function that will do the work

<div v-if="showModal" @close="close">
    <slot></slot>
</div>

  methods: {
       
 
            close() {
                this.showModal = 'false
            }
        }

rameezisrar left a reply on Vue Emit From Slot To Parent

@dawgonking

try this

   this.$root.$emit('close')

or

this.$emit('close')

or

this.$parent.$emit('close')

rameezisrar left a reply on Laravel And Vuetify

@yibr After running

npm install vue-router
npm install vuetify

Update your app.js something like that

import Vue from 'vue';
import VueRouter from 'vue-router';
import routes from './routes';
import Vuetify from 'vuetify';

import axios from 'axios';

window.axios = axios;

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';


Vue.use(VueRouter);

let app = new Vue({
    el: '#app',

    router: new VueRouter(routes)
});


Vue.use(Vuetify, {
    theme: {
        primary: "#1464bf",
      }
})

rameezisrar left a reply on Where Is Put Service Code In Laravel Project?

@kakallatt You can create a different Service Provider for this purpose i.e GoogleClientServiceProvider. Under this file you can bind the implementation.

04 Aug
1 month ago

rameezisrar left a reply on How To Check If Field Was Selected In API Resources?

@ranx99 try this

Post::where('id',  $id)->select('id', 'title',  'subtitle')->firstOrFail();

rameezisrar left a reply on Browser Not Showing The Change After Updating User.vue File

@khosmoe_2019 Make sure you add the 'app' id on the parent

<div id="app">
    <main class="py-4">
        <div class="container">
    <router-view></router-view>
        </div>
    </main>
</div>
03 Aug
1 month ago

rameezisrar left a reply on Vue Js Push Is Not A Function

@david001 try this


<div v-for="(product, index) in products" :key="product.id" >
          <div class="card" >
            <div class="card-header">{{product. name}}</div>

            <div class="col-md-4">

                <div class="card-body">
                        <img :src="product.image">
                        <p>{{product.price}}</p>
                        <p>{{product.category_id}}</p>
                    </div>
                <button class="btn btn-primary"  @click="addProductToCart(product)">
                 
                </button>
                </div>

            </div>
        
     
        
        </div>


rameezisrar left a reply on Vue Js Push Is Not A Function

@david001 I think you are missing the template tags

<template>

<div v-for="product in products" >
          <div class="card" >
            <div class="card-header">{{product. name}}</div>

            <div class="col-md-4">

                <div class="card-body">
                        <img :src="product.image">
                        <p>{{product.price}}</p>
                        <p>{{product.category_id}}</p>
                    </div>
                <button class="btn btn-primary"  @click="addProductToCart(product)">
                 
                </button>
                </div>

            </div>
        
     
        
        </div>

</template>

rameezisrar left a reply on Vue Js Push Is Not A Function

@david001 then try as Bobby said

this.card.push(product)

rameezisrar left a reply on Vue Js Push Is Not A Function

@david001

Why are you sending the params with a get request? I think you want to send a post request once the user hit submit checkout. try this

addProductToCart(product){
                var app = this;
                      
                    app.cart.push(product)

console.log(product);

}
                

Are you getting the product on console?

rameezisrar left a reply on Isset And Equal To. Is There Any Shortcut ?

@mostafalaravel

As per the documentation

@if (count($records) === 1)
    I have one record!
@elseif (count($records) > 1)
    I have multiple records!
@else
    I don't have any records!
@endif
@isset($records)
    // $records is defined and is not null...
@endisset

@empty($records)
    // $records is "empty"...
@endempty
02 Aug
1 month ago

rameezisrar left a reply on Private Files In Laravel

@rocket Instead of storing the books locally, you can think of using amazon S3 server to reduce the size of your Repository also to make it clean.

But If you still need to store the books locally, then save the books with the random characters lets say 60 characters. I hope futurepress/epubjs-reader in not displaying the file name when it is opening up, If that's the case the user can not predict the file name with the book name so they won't be able to access it even if they visit the directory public/books/ .

If somebody tries to access the content of the public/books folder and without the book name, the system will throw a 403 forbidden access error.

rameezisrar left a reply on Sweet Alert 2 Isn't Working

@cq522138 can you please mark the above as Best Reply.

rameezisrar left a reply on Sweet Alert 2 Isn't Working

@cq522138 Add this code in your app.js

import Vue from 'vue';

let app = new Vue({
    el: '#app'
});

rameezisrar left a reply on Sweet Alert 2 Isn't Working

@cq522138 under the bootstrap.js file

window.events = new Vue();

window.flash = function (message, level = 'success'){ // default will be a success message
  
    window.events.$emit('flash', { message,level } );
}

and then on your vue you can call this flash message as your sweetalert

.then((response)=>{
                        this.$router.push('/Category_list')
                        
                      flash('Success');

                    })
                    .catch(()=>{


                    })

01 Aug
1 month ago

rameezisrar left a reply on 500 Internal Server Error

@mahmoudtrageh paste your log file content here which is under storage/logs folder

rameezisrar left a reply on Session Timeout Settings

@zahidnazirkhan

set the value under session.php

'lifetime' => env('SESSION_LIFETIME', 10),
30 Jul
1 month ago

rameezisrar left a reply on VueRouter - Redirection To Page 404 After A Refresh Of The Page

@larasou

You are getting 404 page because laravel couldn't find that route which you have declared in Vue.

On your laravel's web.php routes file, include this

Route::get('/{any}', function () {
    return view('app');
})->where('any', '.*');

replace the view name('app') with your master view.

In this way, you are telling to laravel that I will handle(vue) on my own

rameezisrar left a reply on User Control Can't Return The Old Input Values After Vadiladion

@mostafalaravel

<input type="text" name="username" value="{{ old('username') }}">

Just replace with your input field names

rameezisrar left a reply on How Can This Code Be Refactored To Follow SOLID Principals

@jgirgis your class is doing too many stuff. Consider Singel Responsibility Principle

29 Jul
1 month ago

rameezisrar left a reply on Blade @include Renders Name Of Variable In Stead Of Value

@lemmon

add $ with the variable names

<div style="height:450px;" class="flex flex-col justify-around shadow-xl p-6 w-1/4 rounded-lg text-center mx-2 mb-2">{{--A single plan One--}}
    <div class="flex justify-between mb-6">
        <h5 class="text-md font-bold uppercase text-gray-700 tracking-tight">{{ $name }}</h5>

        <a href="#" class="flex items-baseline font-bold text-blue-500 leading-none">
            <span class="text-lg">$</span>
            <span class="text-4xl">{{ $price }}</span>
        </a>
    </div>

    <div>
        <img src="{{ asset('svg/the-php-practitioner.svg') }}" alt="The PHP Practitioner" class="mx-auto mb-8">
    </div>

    <p class="mb-8 text-gray-700">
        Still undecided? Ease in with a monthly plan that can be canceled in ten seconds.
    </p>

    <a href="" class="pricing-selection-design-button button-blue">Start Learning</a>
</div>{{--end A single plan One--}}