Skip to content

How to get saved value from dropdown in edit page laravel?

inside EmployeeController in the edit function, i have this code and inside edit.blade.php to display the dropdown i have this code This is the employees table and this is departments table Now, the goal is i want the dropdown on edit page to display department name of the employee belongs to, while the dropd…

Composer install to target folder

I am using Composer v1.10.6 and am trying to get the dependencies to install into a specific folder. File structure is like this: So I want the dependencies defined in composer.json to be installed under /some-folder/vendor, but they are just getting installed to /vendor. What property do I add to composer.js…

Is PHP possible to print out variable source code as string?

I have a simple variable like this Now, PHP comes with several print out function print_r result: var_dump result: I want a function that can print out the original source code like this: result: Is there any function that can achieve this? Answer This should work for the exact “restore array” you…

Php Reload When Document Is Changed

This is my php code, and i am trying to create a chat I know that php isn’t the way to go, but I want to have some fun, and it seems to be working out. Also, I want to ask how do you let the chat let real time. I created a document called chat.txt and maybe i can

How to insert emojis in MySQL using Laravel?

My MySQL DB collation is: utf8mb4_unicode_ci As shown below: However when I try to insert it in the table using Laravel – it throws the following error: And this is the store method in my Controller: UPDATE Here is a picture of the challenges table config: Answer This is more of a Database and migration…