REFACTORING #1880 @40m: move creating new directory into interaction

This commit is contained in:
Michal Kváček
2016-11-23 01:30:28 +01:00
parent ca718a5efe
commit 675aec669b
6 changed files with 123 additions and 45 deletions
@@ -0,0 +1,14 @@
<?php
namespace App\CMS\Repositories\FileManager;
use App\Models\FileManager\Directory as DirectoryModel;
class Directory
{
public function checkIfNameExists($name, $directoryId)
{
return DirectoryModel::where('name', $name)
->where('parent_id', $directoryId)
->exists();
}
}