<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;

class Profile extends Model
{
    //

    protected $table = 'profiles';
    protected $fillable = array('name', 'surname', 'email', 'area','user_id','status');
    public $timestamp = true;

	public function users(){ 

    	return $this->belongsToMany('App\User');

	}

	public function  userCreateProfile(){

	    if(Auth::user()->id == $this->user_id){
            return true;

        }else{

	        return false;
        }

    }



}
