For the complete documentation index, see llms.txt. This page is also available as Markdown.

Path

The path method returns the actual path of an attachment file. Call it without any arguments to retrieve the path of the original file. Pass a style name as an argument to retrieve the path of a specific style.

$model->attachment('file')->path();
$model->attachment('file')->path('cover');

You can use any generated style name.

$model->attachment('file')->path('thumbnail');
$model->attachment('file')->path('cover');

Use path() when you need the local file path for server-side processing.

Use url() when you need a public link to the file.

Last updated