<?php 
namespace App\Models;

use Illuminate\Database\Eloquent\Model;


class CustomPages extends Model{

	protected $table = 'custompages';

	public static function getcontent($key){
		$option = CustomPages::where('fieldName', '=', $key)->first();
		if($option){
			return $option->fieldContent;
		}
		return '';
	}

	public static function checkFileNames($name, $path, $extension){
			if(file_exists(public_path().$path.$name.".".$extension)) {
				return CourseApplied::checkimages($name."(1)", $path, $extension);
			}
			return $name;
		}
}
