Never do composer update on live existing sites as it may break site. on prexeisting Laravel sites. Always do composer install
php artisan migrate
php artisan module:seed Users
This will seed all called classes at Modules/Users/Database/Seeders/UsersDatabaseSeeder.php.
Seed dummy users from factory
php artisan db:seed --class=Modules\\Users\\Database\\Seeders\\TestUsersSeeder
This will create dummy users specified on Modules/Users/Database/Seeders/TestUsersSeeder.php
php artisan module:seed Admin
This will add default settings content (logo, seo title data ) into settings table
npm install composer update
[email protected] helloworld
- php artisan serve
- npm run gulp watch
Components are reusable bits of code that function individually.
eg. create a Button
- Run the following command php artisan make:component Button This command generates only two files:
- Button.php
- button.blade.php
Button.php
- located at app/View/Components/Button.php.
- this is where you can put the logic of your component. This is a PHP class where you can manage the data of your component that you can pass on the view. The render method on this file is where the view file is called.
button.blade.php
- located at resources/views/components/button.blade.php.
- this is UI file of your component.
- Displaying components In displaying blade components, you have to prepend it withx- then the name of the blade file without the .blade.php extension. eg. display the newly created Button component In any view file of your Laravel project, you may call the button component with the following:
- Attributes You may also add attributes on the component and access it on the component's class. eg.
Now on the Button.php class, you can access the "success" value on the contructor __construct() by specifying the attribute at parameter. eg. public function __construct($type) { }
The $type variable has the value "success" on this case.
- Passing data from component's class to the view of the component To pass a value from a class to the view, you need to declare a class property inside the component's class.
eg. public $button_type; Now inside the __construct method, you can set this property.
eg. public function __construct($type) { $this->button_type = $type; }
- Accessing component property on the view file On the button.blade.php, you can access the button type with $button_type.
eg. content of resources/views/components/button.blade.php
This is a button
Laravel's doc for more info https://laravel.com/docs/7.x/blade#components.
"npm run gulp sass" "npm run gulp scripts"
php artisan make:component COMPONENT_NAME
- Log in to Plesk
- Click on Git
- Click Add repository
- Enter the remote repository or using the SSH protocol.
- Set destination directory.
- Copy the generated SSH public key to your Git repository for read access only.
- Click Ok
- Once all files are deployed to production, copy .env.example file to .env and update all setting. APP_ENV=production APP_DEBUG=false APP_URL:https://curateship.com Also update DB setting and Mailer setting.
Step2: Configure Plesk Log in to Plesk. Click on Domains and navigate the domain to setup. Click on Hosting Settings. Enable SSH access Change the Document root to the public folder in your app. Usually, this is httpdocs/public Click OK.
Step3: Run commands for deployments
- SSH to IP using port 44221
- CD to httpdocs
- composer update
- php artisan migrate
- php artisan module:seed Users
- php artisan module:seed Admin
- php artisan key:generate
- php artisan config:cache
- php artisan storage:link
- php artisan serve
- upload compiled css and js from local
Install FFmpeg for each individual site in putty:
COMPOSER_MEMORY_LIMIT=-1 composer require php-ffmpeg/php-ffmpeg
Make sure to change max file size in php.ini and server
- upload_max_filesize=500M
- post_max_size=500M
Change path to ffmpeg
- FFMPEG_PATH = /opt/local/ffmpeg/bin/ffmpeg
- FFPROBE_PATH = /opt/local/ffmpeg/bin/ffprobe
- WATERMARK_PATH = /curateship/public/assets/img/play-button-overlay.png
- php artisan config:clear
- php artisan cache:clear
- php artisan vendor:publish
- 2MB is set by default and I extended it as 16MB in case run into memory error