FallOutBoi

FallOutBoi

Member Since 1 Year Ago

Experience Points
2,610
Total
Experience

2,390 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
1
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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
2,610 XP
Aug
18
1 month ago
Activity icon

Replied to Laravel Nginx Shows 404 Only

thanks man but its the same thing again

Aug
17
1 month ago
Activity icon

Started a new Conversation Laravel Nginx Shows 404 Only

Hi guys, i am trying to configure laravel 7 with Nginx but every page i visit it responds with 404 not found page. When i call php artisan route:list it shows all the routes there. I have tried clearing all the caches from view, config, routes even tried to remove vendor and reinstall everything but still no luck. I have tried everything i could with the Nginx config yet it still doesnt work.

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/inc.ng/before/*;

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name inc.ng .inc.ng;
    root home/forge/inc.ng/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    # FORGE CONFIG (DO NOT REMOVE!)
    include forge-conf/inc.ng/server/*;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
 }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        root /home/forge/inc.ng/public;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
      #  fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/inc.ng/after/*;

The server should have a subdomain, like arc-live. I have tried soo many thing i don't know what else to do about it.

Jul
23
2 months ago
Activity icon

Replied to How Can I Allow Only One Route?

thanks alot

Activity icon

Started a new Conversation How Can I Allow Only One Route?

Hi guys i am trying to build an SPA app here with vue, and i want to redirect to index everytime when user tries to visits any route without affecting the api routes. Any way i can achieve this?

Jul
10
2 months ago
Activity icon

Replied to Custom Auth For Nuxt

Umm one question, why in the middleware we're not verifying the tokens?

Jun
22
3 months ago
Activity icon

Awarded Best Reply on How Do You Use Class Properties In Methods?

My bad it was out of scope :(

Activity icon

Replied to How Do You Use Class Properties In Methods?

My bad it was out of scope :(

Activity icon

Started a new Conversation How Do You Use Class Properties In Methods?

Hi guys, can someone please help me understand how can i use object's constructor properties in methods?

export class DB {
  constructor(url, dbname) {
    this.url = url;
    this.dbname = dbname;
    console.log(url, dbname);
  }

  check() {
    MongoClient.connect(this.url, { useUnifiedTopology: true }, function(
      err,
      client
    ) {
      assert.equal(null, err);
      console.log('Connected successfully to server');

      const db = client.db(this.dbName);

      client.close();
    });
  }
}

here i use this simple function to check the database connection but when i run it says Cannot read property 'dbName' of undefined. What am i doing wrong in here? and how can i use some predefined properties in my methods?

Jun
19
3 months ago
Activity icon

Started a new Conversation Need A Little Help With Javascript Class

Hi guys, i am trying to set class properties after calling an axios request, as you can see below i am trying to assign constructors this.USD_HIGHEST and this.USD_LOWEST values. The problem is whenever i call this function and log the class it always returns undefined.

Here's the function

import axios from 'axios';

export default class Currency {
  constructor() {
    this.USD_HIGHEST;
    this.USD_LOWEST;
  }

  usd = () => {
    var self = this;

    axios
      .get('https://api.allorigins.win/get?url=http://rate.am')
      .then((response) => {
        let min_values = response.data.contents
          .split('Նվազագույնը')
          .pop()
          .split('</td><td class="fhd">');

        let max_values = response.data.contents
          .split('Առավելագույնը</td><td class="fhd">')
          .pop()
          .split('</td><td class="fhd">');

        self.USD_HIGHEST = Math.floor(max_values[0]);
        self.USD_LOWEST = Math.floor(min_values[0]);
      })
      .catch((err) => {
        return err;
      });

    return;
  };
}

Here's the invocation

import Currency from './currency.js';

let currency = new Currency();
currency.usd();
console.log(currency.usd());
console.log(currency);
console.log(currency);
Apr
30
4 months ago
Activity icon

Started a new Conversation Missing Required Parameters For [Route: Login] [URI: Login].

Hi guys, i have Auth::routes() in my routes.php file. I just added a function for subdomain and now it says Missing required parameters for [Route: login] [URI: login]. Here's my routes php


Route::group(['domain' => '{subdomain}.' . env('APP_HOST'),'middleware' => ['activity']], function ($subdomain) {

    Route::get('/', function () {
        return view('pages.index');
    })->name('home');
    
        Auth::routes();

Sorry i didn't posted the entire routes because it was too long. in my env APP_HOST is set to inc.loc. But how can i fix the error?

Apr
23
5 months ago
Activity icon

Started a new Conversation How Do Many To Many Polymorphic Tables Work?

Hi guys i am trying to recieve all users from polymorphic table. My polymorphic table's name is assigned_roles with the following columns id, role_id, entity_id, entity_type . This is the model of AssignedRole

//AssignedRole.php

    protected $table = 'assigned_roles';

    public function entity(){
        return $this->morphTo();
    }

    public function user(){
        return $this->morphedByMany(\App\User::class, 'entity');
    }

    public function role(){
        return $this->morphedByMany(\App\Role::class, 'entity');
    }

I am trying to receive based on role model this is what my role model looks like

//Role.php 

    public function user(){
        return $this->morphToMany(\App\AssignedRole::class, 'entity', 'assigned_roles');
    }

and my User.php

 public function assignedRoles()
    {
        return $this->morphMany(App\AssignedRole::class, 'entity_id');
    }

However whenever i use $role->user when $role is an instance of Role Model i am receiving an error

SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'assigned_roles' (SQL: select `assigned_roles`.*, `assigned_roles`.`entity_id` as `pivot_entity_id`, `assigned_roles`.`assigned_role_id` as `pivot_assigned_role_id`, `assigned_roles`.`entity_type` as `pivot_entity_type` from `assigned_roles` inner join `assigned_roles` on `assigned_roles`.`id` = `assigned_roles`.`assigned_role_id` where `assigned_roles`.`entity_id` = 1 and `assigned_roles`.`entity_type` = App\Role) 

How can i receive users based on role through the table?

Apr
11
5 months ago
Activity icon

Replied to Where In Relationship's Relation

Ahh can't believe it was this easy. So it automatically enters role_user table, i just didn't know that

Apr
10
5 months ago
Activity icon

Started a new Conversation Where In Relationship's Relation

Hi guys, i am trying to get all seller type of users using eloquent ORM. I have three tables users, roles and user_role. User table contains standard user info name, email, password, the roles table has the list of the roles that can be assigned to a user, and user_role has both id of an user and role to as foreign key. The problem is now i am trying to get all seller type of users using this query.

$users = User::with('userRole.role')->where('machine_name', 'seller')->paginate(10);

But it returns error

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'userRole.role.machine_name' in 'where clause' (SQL: select * from `users` where `userRole`.`role`.`machine_name` = seller)`

My User model looks like this

class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password', 'type',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token', 'is_admin',
    ];

    public function userRole(){
        return $this->hasOne(\App\UserRole::class);
    }
}

My UserRole Model Looks like this

class UserRole extends Model
{
    protected $table = 'user_role';

    public function user(){
        return $this->belongsTo(\App\User::class);
    }

    public function role(){
        return $this->belongsTo(\App\Role::class);
    }
}

My Roles Model looks like this

class Role extends Model
{
    public $timestamps = false;

    public function userRole(){
        return $this->hasMany(\App\UserRole::class);
    }
}
Mar
25
6 months ago
Activity icon

Replied to How To Stop Laravel From Stripping Url

return response()
    ->json($response, 200, ['Content-type'=> 'application/json; charset=utf-8'], JSON_UNESCAPED_UNICODE);

this fixed the issue

Activity icon

Started a new Conversation How To Stop Laravel From Stripping Url

Hey guys, i am trying to build an app similar to IMDB for some reason laravel strips off cyrillic letters from the url, i was wondering is there any way i can prevent this?

my route is like this

Route::get('titles/{id}/{name}', '[email protected]')->middleware('prerenderIfCrawler');

the name stored in db is like Ford против Ferrari but the url reproduces like so https://mtdb.denisov.pro/titles/39/ford-ferrari. How can i prevent this?