Download the PHP package agifsofyan/noto without Composer
On this page you can find all versions of the php package agifsofyan/noto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download agifsofyan/noto
More information about agifsofyan/noto
Files in agifsofyan/noto
Package noto
Short Description This is a plugin/package to use the file system from Octobercms to work on laravel. This plugin will be very helpful if you have 2 projects (Laravel & Octobercms) with the same 1 DB.
License MIT
Informations about the package noto
About Noto
Noto is a package intended to help synchronize filesystems between OCTOBERCMS and LARAVEL. By following the octobercms filesystem flow. Package includes:
- file relations
- use of system_files table
- naming the path / disk name of the file
- the naming of the relation model of the OCTOBERCMS model
Requirement
- PHP 8.0.28
- LARAVEL Framework 9.52.5
Dependency
- intervention/image
Installation
Run composer require agifsofyan/noto
Configuration
Run php artisan vendor:publish --provider="Agifsofyan\Noto\Providers\NotoServiceProvider"
Will create :
-
config file
noto.phpin the config folder.model_pathis the path of the LARAVEL model usedfile_tableis the database table name for the file to be used. The default for OCTOBERCMS is system_files.model_syncare the registered models. And this is mandatory.- index (left side) of model_sync is the model name of your LARAVEL project.
- the value (right side) of model_sync is the model name of your OCTOBERCMS project.
-
migration file
2023_01_31_000001_Db_System_Files.phpin the database/migrations folder.Run
php artisan migrate
Use
-
Adding
use Agifsofyan\Noto\Traits\NotoMorph;in your model as Traits.Sample:
-
Adding file relation using
morphOneNotoin your model if single upload file.Sample:
-
Adding file relation using
morphManyNotoin your model if multiple upload file.Sample:
-
To Save file use this from your controller after save / update the model data: Sample:
$userfrom your model where themorphOneNotoormorphManyNotorelations are registered.If update data use
$user->save()don't use$user->update(). -
Call the File Url
Call the thumbnail file:
Call the original file: