{"id":21084286,"url":"https://github.com/ahmadhuss/laravel-work","last_synced_at":"2026-05-14T21:06:08.367Z","repository":{"id":100760398,"uuid":"354228480","full_name":"ahmadhuss/laravel-work","owner":"ahmadhuss","description":"Laravel Work!","archived":false,"fork":false,"pushed_at":"2021-05-27T15:15:36.000Z","size":983,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-01T15:53:37.933Z","etag":null,"topics":["database-server","database-settings","database-tables","laravel","seed"],"latest_commit_sha":null,"homepage":"https://app-test-laravel-1.herokuapp.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmadhuss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-03T07:28:27.000Z","updated_at":"2021-05-27T15:15:38.000Z","dependencies_parsed_at":"2023-06-09T16:15:40.404Z","dependency_job_id":null,"html_url":"https://github.com/ahmadhuss/laravel-work","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ahmadhuss/laravel-work","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadhuss%2Flaravel-work","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadhuss%2Flaravel-work/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadhuss%2Flaravel-work/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadhuss%2Flaravel-work/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmadhuss","download_url":"https://codeload.github.com/ahmadhuss/laravel-work/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadhuss%2Flaravel-work/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33043287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-server","database-settings","database-tables","laravel","seed"],"created_at":"2024-11-19T20:23:47.051Z","updated_at":"2026-05-14T21:06:08.350Z","avatar_url":"https://github.com/ahmadhuss.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How can we use this repo?\n\n\n# Install\n```sh\ncomposer install\n```\nNext you can clone the `.env.example` file into the `.env` file. This means that you have to create the same file in the `root` directory under a different name e.g. `.env` and copy paste the same credentials like `.env.example` file.\n\nLaravel has a built-in CLI tool called `artisan`. Your application must generate a unique base 64 key that Laravel uses behind the scenes to bootstrap this project.\n\n**Command:**\n\n```sh\nphp artisan key:generate\n```\n\nIt will automatically find your `.env` file and place the base 64 value in the file.\n\n**Output inside the file:**\n```\nAPP_KEY=base64:T0huMR5Wx9EoDmjTxniKTofHD/7cOiDeVVD9eTKuCa0=\n```\n\n## Additional Note:\nAs you can see it is necessary to create the `.env` file in your local to bootstrap the project. But `Laravel` contains 2 methods to connect to the database server.\n\n- Use of the `.env` variables *(I prefer this one)*\n- Use of the file located at the `config/database.php`\n\n\n\n## Use of the `.env` variables:\n\nWhen you create this file with copy paste credentials you can see default; the database variables are written something like this:\n ```\nDB_CONNECTION=mysql  \nDB_HOST=127.0.0.1  \nDB_PORT=3306  \nDB_DATABASE=test_app  \nDB_USERNAME=root  \nDB_PASSWORD=\n```\n\nYou can edit values according to your own database personal preference. I am using Postgres in this case.\n\n##  Use of the file located at the `config/database.php`\n\n**Note:** When Laravel bootstraps the project it gives priority to the `.env` file as compared to `config/**` files. You can see `config/database.php` file contains an associated array with default database settings like this.\n\n```\nreturn [\n    \n    'default' =\u003e env('DB_CONNECTION', 'mysql'),\n    'connections' =\u003e [\n        'mysql' =\u003e [\n            'driver' =\u003e 'mysql',\n            'url' =\u003e env('DATABASE_URL'),\n            'host' =\u003e env('DB_HOST', '127.0.0.1'),\n            'port' =\u003e env('DB_PORT', '3306'),\n            'database' =\u003e env('DB_DATABASE', 'forge'),\n            'username' =\u003e env('DB_USERNAME', 'forge'),\n            'password' =\u003e env('DB_PASSWORD', ''),\n            'unix_socket' =\u003e env('DB_SOCKET', ''),\n            'charset' =\u003e 'utf8mb4',\n            'collation' =\u003e 'utf8mb4_unicode_ci',\n            'prefix' =\u003e '',\n            'prefix_indexes' =\u003e true,\n            'strict' =\u003e true,\n            'engine' =\u003e null,\n            'options' =\u003e extension_loaded('pdo_mysql') ? array_filter([\n                PDO::MYSQL_ATTR_SSL_CA =\u003e env('MYSQL_ATTR_SSL_CA'),\n            ]) : [],\n        ],\n    ]\n    ]\n```\n\nYou can only use these settings if variables from the `.env` file will be deleted. Otherwise, Laravel gives priority to `.env` variables.\n\nDelete the variables from the `.env`:\n\n\n~~DB_CONNECTION=mysql~~  \n~~DB_HOST=127.0.0.1~~  \n~~DB_PORT=3306~~  \n~~DB_DATABASE=test_app~~  \n~~DB_USERNAME=root~~  \n~~DB_PASSWORD=~~\n\nLastly, Update the `config/database.php` with your database server settings:\n\n```\n'default' =\u003e env('DB_CONNECTION', 'pgsql')\n'database' =\u003e env('DB_DATABASE', 'shop_test'),\n'username' =\u003e env('DB_USERNAME', 'postgres'),\n'password' =\u003e env('DB_PASSWORD', 'a')\n```\n\n# Database\nI am using  **Postgres** and inside `.env` file my database server credentials are:\n```\nDB_CONNECTION=pgsql\nDB_HOST=127.0.0.1  \nDB_PORT=5432\nDB_DATABASE=shop_test\nDB_USERNAME=postgres\nDB_PASSWORD=a\n```\n\nHowever, your main server and database server get started.\n\n# Migration (Transform into real database tables)\nAt the last make sure after updating your database settings. Please use `artisan` CLI to migrate the database tables.\n```sh\nphp artisan migrate\n```\n\n# Seed \u0026 Adminstration credentials for Local \u0026 Remote\nWe can manage products \u0026 categories with Admin credentials.\n\n### For the local environment:\nI created the additional Seeder class named `UserSeeder.php` for User Model which is located at the `database/seeders/UserSeeder.php` and ignoring the seeding with Model Factories. So, In local you can seed the User Model with this command.\n```sh\nphp artisan db:seed\n```\nBehind the scenes it will seed the database with the test account in your database which has following creditenials.\n```sh\nname: admin\nemail: admin@admin.com\npassword: password\n```\nYou can use this account in your local to manage products \u0026 categories.\n\n\n### For production Heroku:\nThe creditials for proudction site admin are:\n```sh\nname: admin\nemail: admin@admin.com\npassword: 12345678\n```\n\n# Storage\n### For the local:\nIf you are using the repo in local environmnet, the database will store the image URL something like this.\n```\nhttp://localhost/storage/photos/nkI0CF8pLjIuRdPbL171ycACGKNrBYAZ4GYeyYdx.jpg\n```\n\nThe URL `http://localhost` is taken from the environment variable (`APP_URL`) `.env` file. You can change the value according to your local hostname.\n\nFor local environments it is important, all uploaded items will store in the `storage/app/public` directory. Therefore, we need to use the `artisan` CLI command and create the `storage/app/public` directory shortcut (symlink) into `public/storage`.\n\n **Why?** because the root `public` directory is meant to be web-accessible. That's why we're creating a shortcut of our `storage/app/public` directory into the `public/storage` directory.\n\n\n### To see uploaded photo in your local:\n\nPlease make sure you create the symlink of the following directory `storage/app/public` to `public/storage.` The command for this is:\n\n```sh\nphp artisan storage:link\n```\n\n### For the production:\nCurrently, the production version is using [AWS S3](https://aws.amazon.com/s3) for the storage. If you want to use this repo and deploy it to other services like shared hosting or somewhere else. You can configure these 2 lines inside the `ProductController.php` according to your production environment.\n\nCurrently:\n```\n$path = $request-\u003efile('photo')-\u003estore('photos', self::getStorageEnvironment());\n```\n\nModified:\n\n```\n$path = $request-\u003efile('photo')-\u003estore('photos', 'public');\n```\n\nCurrently:\n```\nProduct::create([\n\t'photo' =\u003e Storage::disk(self::getStorageEnvironment())-\u003eurl($path)\n]);\n```\n \nModified:\n```\nProduct::create([\n\t'photo' =\u003e Storage::disk('public')-\u003eurl($path)\n]);\n```\n\n\n# Template I am using\n[Download Link](https://github.com/StartBootstrap/startbootstrap-shop-homepage/releases/tag/v4.2.3)\n\n# Deployment\n[Heroku](https://www.heroku.com)\n\n[AWS S3](https://aws.amazon.com/s3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadhuss%2Flaravel-work","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmadhuss%2Flaravel-work","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadhuss%2Flaravel-work/lists"}