Skip to main content

Posts

Showing posts from March, 2023

Set cron job in redhat linux os

 Use full links All user (Login user) cron job are placed in crontab. Each user can schedule its job independently. User can access its cron job with this command -crontab -e -u root and cron table will open. 1) https://devarticles.in/how-to-run-url-from-cronjob-at-specific-time-in-linux/ 2) https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/ 3) Run command after specific time interval https://linuxhint.com/execute-crontab-every-5-minutes/#:~:text=A%20crontab%20has%205%20fields,time%20a%20command%20should%20execute.&text=To%20execute%20a%20crontab%20every,command%20after%20every%205%20minutes. https://www.tecmint.com/create-and-manage-cron-jobs-on-linux/

Facades in laravel

Facades provide static like interface to services inside the service container. we can access underlying implementation on these services (methods and properties). we can access every method in service classes without creating their instance(object). Mean it automatically resolve dependencies by creating instance of the service classes. How facades work ? 1) The service class contain only one method 'getFacadeAccessor()'. 2 ) This class also extend facades base class 3) So when we call method of this class without instance like cache::get('name) 4) It automatically call getFacadeAccessor() method create instance than find the method of the service class. How do I create a facade class and use in my application ? Since laravel largely uses facades rather every non static function has its equivalent facade available in service container, we must also follow the same way in our custom application. All of Laravel’s facades are defined in the Illuminate\Support\Facades namespace...

Json-server Api's crud operations

Git-Hub repo with setup guide. https://github.com/typicode/json-server 1) Install json server Please visit the json-server official site and find this command. Install json-server globaly into your system -npm install -g json-server 2) Start json-server with command Open cmd and go to the locaation where .json file present run the this command -npx json-server --watch db.json  3) Delete data with child table data (delete relation record).  Hi! This is not a random error. I found that if there is some kind of connection between elements, then DELETE request will erase both of them: I have a "database": { "users":[ {"id":1, "name": "Bob", "email":"bob@gmailcom", "age": 35}, {"id":2, "name": "Sue", "email":"sue@gmailcom", "age": 32}, {"id":3, "name": "Cloe", "email":"cloe@gmailco...