class PostFormTest extends Model
{
public $name_agent;
public $email_agent;
public $phone_agent;
public $title;
public $id_category;
public $id_sub_category;
public $city;
public $price;
public $term_price_product;
public $term_time_post;
public $maps;
public $size;
public function rules(){
return[
[['name_agent', 'email_agent', 'phone_agent', 'title', 'id_category', 'id_sub_category', 'city', 'price',
'term_price_product', 'term_time_post'], 'required'],
['email_agent', 'email'],
['phone_agent', 'match', 'pattern' => '/^\+\d+$/'],
['phone_agent', 'string', 'min' => 6],
['phone_agent', 'string', 'max' => 20],
['title', 'string', 'min' => 6, 'max' => 255],
['maps', 'safe'],
['size', 'number', 'min' => 1]
];
}
}
use Intervention\Image\Image;
$img = Image::make('ссылка на картинку.jpg')->resize(300, 200);
$img->save('bar.jpg', 60);