app\models\Song::byPath PHP 메소드

byPath() 공개 정적인 메소드

Get a Song record using its path.
public static byPath ( string $path ) : Song | null
$path string
리턴 Song | null
    public static function byPath($path)
    {
        return self::find(File::getHash($path));
    }

Usage Example

예제 #1
0
 /**
  * Remove a song whose info matches with data sent from AWS.
  *
  * @param RemoveSongRequest $request
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function remove(RemoveSongRequest $request)
 {
     abort_unless($song = Song::byPath("s3://{$request->bucket}/{$request->key}"), 404);
     $song->delete();
     event(new LibraryChanged());
     return response()->json();
 }
All Usage Examples Of app\models\Song::byPath