👺
Cheatsheet
  • 👋My cheatsheet
  • 🐘PHP
    • Тернарные операторы
    • Замыкания в PHP
    • Таблица сравнения типов PHP
  • 🟨JS
    • JS cheat sheet
    • Тернарные операторы || ?? &&
    • Таблица сравнения типов JS
    • Область видимости в JS
    • Перебор объектов через for(key in obj)
    • Доступ к свойству через переменную []
    • this в JS
    • Конструктор, оператор "new"
    • bind привязка контекста (this)
    • Замыкания в JS ...
  • ❤️Laravel
    • Laravel websockets
    • Загрузка файлов и пути к ним
    • Vite сборка изображений
    • Vite сборка CSS и JS
    • Vite подключение jQuery
    • Vite подключение Bootstrap
    • Laravel AJAX (with jQuery)
    • Дерево категорий Laravel
    • Laravel + CK-Editor + El FInder
    • Laravel deploy
    • Laravel фасады и сервис провайдеры
    • Отношения
      • Один-к-Одному
      • Один-ко-Многим
      • Многие-ко-Многим
      • Полиморфные отношения
    • Laravel cheatsheet (MAIN)
    • Laravel cheatsheet (BIG)
      • Artisan
      • Auth
      • Blade
      • Cache
      • Composer
      • Config
      • Container
      • Cookie
      • DB
      • Environment
      • Event
      • Eloquent Model
      • File
      • Form
      • HTML
      • Helper
      • Input
      • Lang
      • Log
      • Mail
      • Pagination
      • Queue
      • Redirect
      • Request
      • Response
      • Route
      • SSH
      • Schema
      • Security
      • Session
      • String
      • URL
      • UnitTes
      • Validation
      • View
    • Laravel cheatsheet (BIG PLAIN)
  • 📕PDO
    • SELECT
    • WHERE
    • INSERT
    • UPDATE
    • DELETE
    • JOIN
    • GROUP BY
    • Дерево
    • Дерево ООП
    • Дерево в массив
  • 🐋Docker
    • Docker hub push
    • Docker offline
  • 🥤Gulp
  • 🌊jQuery
  • 🪄Composer
  • 4️⃣Composer PSR-4
  • 🍥RegEx
  • 🐙Git
  • 🧑‍💻Node js
  • 🛍️PHPStorm
  • 💻Zsh
  • 🤖Arduino
Powered by GitBook
On this page
  1. Laravel
  2. Laravel cheatsheet (BIG)

File

File::exists('path');
File::get('path');
File::getRemote('path');
// Get a file's contents by requiring it
 File::getRequire('path');
// Require the given file once
 File::requireOnce('path');
// Write the contents of a file
 File::put('path', 'contents');
// Append to a file
 File::append('path', 'data');
// Delete the file at a given path
 File::delete('path');
// Move a file to a new location
 File::move('path', 'target');
// Copy a file to a new location
 File::copy('path', 'target');
// Extract the file extension from a file path
 File::extension('path');
// Get the file type of a given file
 File::type('path');
// Get the file size of a given file
 File::size('path');
// Get the file's last modification time
 File::lastModified('path');
// Determine if the given path is a directory
 File::isDirectory('directory');
// Determine if the given path is writable
 File::isWritable('path');
// Determine if the given path is a file
 File::isFile('file');
// Find path names matching a given pattern.
 File::glob($patterns, $flag);
// Get an array of all files in a directory.
 File::files('directory');
// Get all of the files from the given directory (recursive).
 File::allFiles('directory');
// Get all of the directories within a given directory.
 File::directories('directory');
// Create a directory
 File::makeDirectory('path',  $mode = 0777, $recursive = false);
// Copy a directory from one location to another
 File::copyDirectory('directory', 'destination', $options = null);
// Recursively delete a directory
 File::deleteDirectory('directory', $preserve = false);
// Empty the specified directory of all files and folders
 File::cleanDirectory('directory');

Last updated 2 years ago

❤️