From be7619ef57d34a52a6c2b422656679774ca7f45a Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Wed, 4 Dec 2019 21:25:18 +0700 Subject: [PATCH] update seeder, provider app and readme --- README.md | 63 ++++++++++++++++++++++++++++ app/Providers/AppServiceProvider.php | 8 +--- database/seeds/UsersTableSeeder.php | 5 ++- 3 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8362c39 --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ + +# Getting started + +## Installation + +Please check the official laravel installation guide for server requirements before you start. [Official Documentation](https://laravel.com/docs/5.4/installation#installation) + + +Clone the repository + + git clone [remote] + +Switch to the repo folder + + cd [remote-name] + +Install all the dependencies using composer + + composer install + +Create database for this app, copy the example env file and make the required database configuration changes in the .env file + + cp .env.example .env + +Run the database migrations (**Set the database connection in .env before migrating**) + + php artisan migrate --seed + +Start the local development server + + php artisan serve + +You can now access the server at http://localhost:8000 + +# Code overview + +## Folders + +- `app/Models` - Contains all the Eloquent models +- `app/Http/Controllers` - Contains all the controllers +- `config` - Contains all the application configuration files +- `database/factories` - Contains the model factory for all the models +- `database/migrations` - Contains all the database migrations +- `database/seeds` - Contains the database seeder +- `routes` - Contains all the api routes defined in api.php file + +## Environment variables + +- `.env` - Environment variables can be set in this file + +***Note*** : You can quickly set the database information and other variables in this file and have the application fully working. + +---------- +# Default SuperUser + +Default Email : + + admin@example.com + +Password : + + password + diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index c73c04b..d245c52 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -27,12 +27,6 @@ class AppServiceProvider extends ServiceProvider public function boot() { Schema::defaultStringLength(191); - $pengaturan = DB::table('pengaturan')->first(); - if($pengaturan == null){ - $nama = 'PAUD TERPADU MUSTIKA ILMU'; - }else{ - $nama = $pengaturan->nama; - } - View::share('sitename', $nama); + View::share('sitename', 'SPP PAUD SD | Sample App Laravel'); } } diff --git a/database/seeds/UsersTableSeeder.php b/database/seeds/UsersTableSeeder.php index fc27400..218abfe 100644 --- a/database/seeds/UsersTableSeeder.php +++ b/database/seeds/UsersTableSeeder.php @@ -14,9 +14,10 @@ class UsersTableSeeder extends Seeder { DB::table('users')->insert([ 'name' => 'admin', - 'email' => 'id.projectkan@gmail.com', + 'email' => 'admin@example.com', 'password' => bcrypt('password'), - 'role' => 'Admin' + 'role' => 'Admin', + 'created_at' => now() ]); } }