├── public ├── favicon.ico ├── robots.txt ├── css │ ├── images │ │ ├── ui-icons_2694e8_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_3d80b3_256x240.png │ │ ├── ui-icons_72a7cf_256x240.png │ │ ├── ui-icons_ffffff_256x240.png │ │ ├── ui-bg_glass_100_e4f1fb_1x400.png │ │ ├── ui-bg_glass_50_3baae3_1x400.png │ │ ├── ui-bg_glass_80_d7ebf9_1x400.png │ │ ├── ui-bg_diagonals-thick_90_eeeeee_40x40.png │ │ ├── ui-bg_highlight-hard_100_f2f5f7_1x100.png │ │ ├── ui-bg_highlight-hard_70_000000_1x100.png │ │ ├── ui-bg_highlight-soft_100_deedf7_1x100.png │ │ └── ui-bg_highlight-soft_25_ffef8f_1x100.png │ └── jquery.appendGrid-1.7.1.css ├── .htaccess ├── web.config ├── index.php └── js │ └── checkbox.js ├── database ├── .gitignore ├── factories │ ├── Product_CategoryFactory.php │ ├── CustomerFactory.php │ ├── ManufacturerFactory.php │ ├── ProductFactory.php │ └── UserFactory.php ├── seeds │ ├── CommonTableSeeder.php │ ├── DatabaseSeeder.php │ ├── UserTableSeeder.php │ └── CompanyTableSeeder.php └── migrations │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2017_12_26_033923_creat_product_categories_table.php │ ├── 2017_12_26_035009_creat_common_codes_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2018_01_08_065945_creat_sale_table.php │ ├── 2017_12_17_080108_creat_companys_table.php │ ├── 2018_01_04_154235_creat_purchase_table.php │ ├── 2017_12_19_160045_creat_customer_table.php │ ├── 2017_12_20_070714_creat_manufacturer_table.php │ ├── 2018_01_08_070007_creat_sale_details_table.php │ ├── 2018_01_04_155100_creat_purchase_detail_table.php │ ├── 2017_12_26_035014_creat_products_table.php │ └── 2017_12_14_135113_entrust_setup_tables.php ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── resources ├── views │ ├── product_categories │ │ ├── show.blade.php │ │ ├── child.blade.php │ │ ├── index.blade.php │ │ ├── child_select.blade.php │ │ ├── create.blade.php │ │ └── edit.blade.php │ ├── vendor │ │ ├── mail │ │ │ ├── markdown │ │ │ │ ├── panel.blade.php │ │ │ │ ├── table.blade.php │ │ │ │ ├── footer.blade.php │ │ │ │ ├── promotion.blade.php │ │ │ │ ├── subcopy.blade.php │ │ │ │ ├── button.blade.php │ │ │ │ ├── header.blade.php │ │ │ │ ├── promotion │ │ │ │ │ └── button.blade.php │ │ │ │ ├── layout.blade.php │ │ │ │ └── message.blade.php │ │ │ └── html │ │ │ │ ├── table.blade.php │ │ │ │ ├── header.blade.php │ │ │ │ ├── subcopy.blade.php │ │ │ │ ├── promotion.blade.php │ │ │ │ ├── footer.blade.php │ │ │ │ ├── panel.blade.php │ │ │ │ ├── promotion │ │ │ │ └── button.blade.php │ │ │ │ ├── message.blade.php │ │ │ │ ├── button.blade.php │ │ │ │ └── layout.blade.php │ │ ├── pagination │ │ │ ├── simple-default.blade.php │ │ │ ├── simple-bootstrap-4.blade.php │ │ │ ├── default.blade.php │ │ │ ├── semantic-ui.blade.php │ │ │ └── bootstrap-4.blade.php │ │ └── notifications │ │ │ └── email.blade.php │ ├── product │ │ ├── child.blade.php │ │ ├── child_select.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── home.blade.php │ ├── permissions │ │ ├── show.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── child.blade.php │ ├── commoncode │ │ ├── show.blade.php │ │ ├── index.blade.php │ │ ├── edit.blade.php │ │ └── create.blade.php │ ├── users │ │ ├── show.blade.php │ │ ├── edit_profile.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── create.blade.php │ ├── roles │ │ ├── show.blade.php │ │ └── index.blade.php │ ├── sale │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── sale_return │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── purchase │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── purchase_return │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── auth │ │ └── passwords │ │ │ └── email.blade.php │ ├── company │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── customer │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── manufacturer │ │ ├── index.blade.php │ │ └── show.blade.php │ └── welcome.blade.php ├── assets │ ├── sass │ │ ├── app.scss │ │ └── _variables.scss │ └── js │ │ ├── components │ │ └── ExampleComponent.vue │ │ ├── app.js │ │ └── bootstrap.js └── lang │ └── en │ ├── pagination.php │ ├── auth.php │ └── passwords.php ├── .gitattributes ├── .gitignore ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── app ├── Customer.php ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── TrimStrings.php │ │ ├── RedirectIfAuthenticated.php │ │ └── TrustProxies.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── HomeController.php │ │ └── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── ResetPasswordController.php │ │ │ ├── LoginController.php │ │ │ └── RegisterController.php │ └── Kernel.php ├── Company.php ├── Manufacturer.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Sales.php ├── Purchase.php ├── Role.php ├── Sale_details.php ├── PurchaseDetail.php ├── Common_Code.php ├── Product_Category.php ├── User.php ├── Services │ └── Menu.php ├── Permission.php ├── Console │ └── Kernel.php ├── Product.php └── Exceptions │ └── Handler.php ├── routes ├── channels.php ├── api.php ├── console.php └── web.php ├── webpack.mix.js ├── server.php ├── .env.example ├── config ├── view.php ├── services.php ├── broadcasting.php ├── filesystems.php ├── trustedproxy.php ├── queue.php └── cache.php ├── phpunit.xml ├── package.json ├── readme.md ├── composer.json ├── artisan └── mysql_function_query.txt /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/views/product_categories/show.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/panel.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/table.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/footer.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/promotion.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/subcopy.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/button.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }}: {{ $url }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/header.blade.php: -------------------------------------------------------------------------------- 1 | [{{ $slot }}]({{ $url }}) 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/promotion/button.blade.php: -------------------------------------------------------------------------------- 1 | [{{ $slot }}]({{ $url }}) 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/table.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{ Illuminate\Mail\Markdown::parse($slot) }} 3 |
4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /public/css/images/ui-icons_2694e8_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-icons_2694e8_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_3d80b3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-icons_3d80b3_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_72a7cf_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-icons_72a7cf_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-bg_glass_100_e4f1fb_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_glass_100_e4f1fb_1x400.png -------------------------------------------------------------------------------- /public/css/images/ui-bg_glass_50_3baae3_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_glass_50_3baae3_1x400.png -------------------------------------------------------------------------------- /public/css/images/ui-bg_glass_80_d7ebf9_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_glass_80_d7ebf9_1x400.png -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /public/css/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png -------------------------------------------------------------------------------- /public/css/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png -------------------------------------------------------------------------------- /public/css/images/ui-bg_highlight-hard_70_000000_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_highlight-hard_70_000000_1x100.png -------------------------------------------------------------------------------- /public/css/images/ui-bg_highlight-soft_100_deedf7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_highlight-soft_100_deedf7_1x100.png -------------------------------------------------------------------------------- /public/css/images/ui-bg_highlight-soft_25_ffef8f_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobinChien/laravel-ERP/HEAD/public/css/images/ui-bg_highlight-soft_25_ffef8f_1x100.png -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/header.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ $slot }} 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | /.idea 7 | /.vagrant 8 | Homestead.json 9 | Homestead.yaml 10 | npm-debug.log 11 | yarn-error.log 12 | .env 13 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ Illuminate\Mail\Markdown::parse($slot) }} 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import "~bootstrap-sass/assets/stylesheets/bootstrap"; 10 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/promotion.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 |
4 | {{ Illuminate\Mail\Markdown::parse($slot) }} 5 |
8 | -------------------------------------------------------------------------------- /database/factories/Product_CategoryFactory.php: -------------------------------------------------------------------------------- 1 | define(App\Product_Category::class, function (Faker $faker) { 6 | return [ 7 | // 8 | 'category_name' => $faker->name, 9 | 'parent_id' => '0', 10 | ]; 11 | }); 12 | -------------------------------------------------------------------------------- /app/Customer.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/footer.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | belongsTo(Customer::class, 'customer_id'); 16 | } 17 | public function user() 18 | { 19 | return $this->belongsTo(User::class,'user_id','user_id'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/panel.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 |
4 | 5 | 6 | 9 | 10 |
7 | {{ Illuminate\Mail\Markdown::parse($slot) }} 8 |
11 |
14 | -------------------------------------------------------------------------------- /database/seeds/CommonTableSeeder.php: -------------------------------------------------------------------------------- 1 | code_name = '袋'; 17 | $super->parent_id = '#'; 18 | $super->permission_id = '2'; 19 | 20 | $super->save(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/promotion/button.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 |
4 | 5 | 6 | 9 | 10 |
7 | {{ $slot }} 8 |
11 |
14 | -------------------------------------------------------------------------------- /resources/views/product/child.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ str_repeat(' |', isset($i) ? $i++ : 0) . $product_table['category']->product_name }} 4 | 5 | 6 | {{ $product_table['category']->qty }} 7 | 8 | 9 | 10 | @if(count($product_table['childs'])>0) 11 | @foreach($product_table['childs'] as $product_table) 12 | @include('product.child', ['category' => $category, 'i' => isset($i) ? $i : 1]) 13 | @endforeach 14 | @endif 15 | -------------------------------------------------------------------------------- /app/Purchase.php: -------------------------------------------------------------------------------- 1 | belongsTo(Manufacturer::class, 'manufacturer_id'); 16 | } 17 | public function user() 18 | { 19 | return $this->belongsTo(User::class,'user_id','user_id'); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/Role.php: -------------------------------------------------------------------------------- 1 | belongsToMany(User::class,'role_user','user_id','role_id'); 13 | } 14 | 15 | public function permissions() 16 | { 17 | return $this->belongsToMany(Permission::class); 18 | } 19 | 20 | protected $fillable = [ 21 | 'name', 'display_name', 'description', 22 | ]; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/Sale_details.php: -------------------------------------------------------------------------------- 1 | belongsTo(Product::class, 'product_id'); 19 | } 20 | public function sales() 21 | { 22 | return $this->belongsTo(Sales::class, 'sale_id'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Http\Response 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/PurchaseDetail.php: -------------------------------------------------------------------------------- 1 | belongsTo(Product::class, 'product_id'); 18 | } 19 | public function purchase() 20 | { 21 | return $this->belongsTo(Purchase::class, 'purchase_id'); 22 | } 23 | // 24 | } 25 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/assets/js/app.js', 'public/js') 15 | .sass('resources/assets/sass/app.scss', 'public/css'); 16 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /app/Common_Code.php: -------------------------------------------------------------------------------- 1 | belongsTo(Permission::class); 15 | } 16 | public function parent() 17 | { 18 | return $this->belongsTo(Common_Code::class, 'parent_id', 'id'); 19 | } 20 | 21 | public function children() 22 | { 23 | return $this->hasMany(Permission::class, 'parent_id'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | 8 | DB_CONNECTION=mysql 9 | DB_HOST=127.0.0.1 10 | DB_PORT=3306 11 | DB_DATABASE=homestead 12 | DB_USERNAME=homestead 13 | DB_PASSWORD=secret 14 | 15 | BROADCAST_DRIVER=log 16 | CACHE_DRIVER=file 17 | SESSION_DRIVER=file 18 | SESSION_LIFETIME=120 19 | QUEUE_DRIVER=sync 20 | 21 | REDIS_HOST=127.0.0.1 22 | REDIS_PASSWORD=null 23 | REDIS_PORT=6379 24 | 25 | MAIL_DRIVER=smtp 26 | MAIL_HOST=smtp.mailtrap.io 27 | MAIL_PORT=2525 28 | MAIL_USERNAME=null 29 | MAIL_PASSWORD=null 30 | MAIL_ENCRYPTION=null 31 | 32 | PUSHER_APP_ID= 33 | PUSHER_APP_KEY= 34 | PUSHER_APP_SECRET= 35 | -------------------------------------------------------------------------------- /resources/assets/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /app/Product_Category.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Product_Category::class); 17 | } 18 | 19 | public function parent() 20 | { 21 | return $this->hasOne(Product_Category::class, 'id', 'parent_id'); 22 | } 23 | 24 | public function children() 25 | { 26 | return $this->hasMany(Product_Category::class, 'parent_id', 'id'); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | window.Vue = require('vue'); 11 | 12 | /** 13 | * Next, we will create a fresh Vue application instance and attach it to 14 | * the page. Then, you may begin adding components to this application 15 | * or customize the JavaScript scaffolding to fit your unique needs. 16 | */ 17 | 18 | Vue.component('example-component', require('./components/ExampleComponent.vue')); 19 | 20 | const app = new Vue({ 21 | el: '#app' 22 | }); 23 | -------------------------------------------------------------------------------- /database/factories/CustomerFactory.php: -------------------------------------------------------------------------------- 1 | define(App\Customer::class, function (Faker $faker) { 6 | return [ 7 | // 8 | 'customer_code' => $faker->unique()->numberBetween($min = 10000, $max = 99999), 9 | 'customer_name' => $faker->name, 10 | 'customer_owner' => $faker->name, 11 | 'customer_phone' => $faker->isbn10, 12 | 'customer_fax' => $faker->isbn10, 13 | 'customer_ZipCode' => $faker->postcode, 14 | 'customer_email' => $faker->unique()->safeEmail, 15 | 'customer_liaison' => $faker->name, 16 | 'customer_address' => $faker->address, 17 | 'customer_GUInumber' => $faker->randomNumber(), 18 | ]; 19 | }); 20 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Role::class, 'role_user', 'user_id', 'role_id'); 18 | 19 | } 20 | 21 | protected $fillable = [ 22 | 'user_name', 'user_email', 'password', 'user_birth', 'user_addr', 'user_phone', 'user_status', 23 | 24 | ]; 25 | 26 | protected $hidden = [ 27 | 'password', 'remember_token', 28 | ]; 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 17 | @endif 18 | -------------------------------------------------------------------------------- /database/factories/ManufacturerFactory.php: -------------------------------------------------------------------------------- 1 | define(App\Manufacturer::class, function (Faker $faker) { 6 | return [ 7 | 'manufacturer_code' => $faker->unique()->numberBetween($min = 10000, $max = 99999), 8 | 'manufacturer_name' => $faker->name, 9 | 'manufacturer_owner' => $faker->name, 10 | 'manufacturer_phone' => $faker->isbn10, 11 | 'manufacturer_fax' => $faker->isbn10, 12 | 'manufacturer_ZipCode' => $faker->postcode, 13 | 'manufacturer_email' => $faker->unique()->safeEmail, 14 | 'manufacturer_liaison' => $faker->name, 15 | 'manufacturer_address' => $faker->address, 16 | 'manufacturer_GUInumber' => $faker->randomNumber(), 17 | ]; 18 | }); 19 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(PermissionTableSeeder::class); 15 | $this->call(RoleTableSeeder::class); 16 | $this->call(UserTableSeeder::class); 17 | $this->call(CompanyTableSeeder::class); 18 | $this->call(CommonTableSeeder::class); 19 | factory(App\Manufacturer::class,10)->create(); 20 | factory(App\Customer::class,10)->create(); 21 | factory(App\Product_Category::class,10)->create(); 22 | factory(App\Product::class,100)->create(); 23 | 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/views/product_categories/child.blade.php: -------------------------------------------------------------------------------- 1 | 2 | {{ str_repeat('----', isset($i) ? $i++ : 0) . $category['category']->category_name }} 3 | 4 | @permission('permission-show') 5 | Show 6 | @endpermission 7 | @permission('product_categories-edit') 8 | Edit 9 | @endpermission 10 | 11 | @if(count($category['childs'])>0) 12 | @foreach($category['childs'] as $category) 13 | @include('product_categories.child', ['category' => $category, 'i' => isset($i) ? $i : 1]) 14 | @endforeach 15 | @endif 16 | 17 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/message.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::layout') 2 | {{-- Header --}} 3 | @slot('header') 4 | @component('mail::header', ['url' => config('app.url')]) 5 | {{ config('app.name') }} 6 | @endcomponent 7 | @endslot 8 | 9 | {{-- Body --}} 10 | {{ $slot }} 11 | 12 | {{-- Subcopy --}} 13 | @isset($subcopy) 14 | @slot('subcopy') 15 | @component('mail::subcopy') 16 | {{ $subcopy }} 17 | @endcomponent 18 | @endslot 19 | @endisset 20 | 21 | {{-- Footer --}} 22 | @slot('footer') 23 | @component('mail::footer') 24 | © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. 25 | @endcomponent 26 | @endslot 27 | @endcomponent 28 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/message.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::layout') 2 | {{-- Header --}} 3 | @slot('header') 4 | @component('mail::header', ['url' => config('app.url')]) 5 | {{ config('app.name') }} 6 | @endcomponent 7 | @endslot 8 | 9 | {{-- Body --}} 10 | {{ $slot }} 11 | 12 | {{-- Subcopy --}} 13 | @isset($subcopy) 14 | @slot('subcopy') 15 | @component('mail::subcopy') 16 | {{ $subcopy }} 17 | @endcomponent 18 | @endslot 19 | @endisset 20 | 21 | {{-- Footer --}} 22 | @slot('footer') 23 | @component('mail::footer') 24 | © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. 25 | @endcomponent 26 | @endslot 27 | @endcomponent 28 | -------------------------------------------------------------------------------- /database/factories/ProductFactory.php: -------------------------------------------------------------------------------- 1 | define(App\Product::class, function (Faker $faker) { 6 | $common_id = App\Common_Code::pluck('id'); 7 | $category_id = App\Product_Category::pluck('id'); 8 | $manufacturer_id = App\Manufacturer::pluck('id'); 9 | return [ 10 | 'product_code' => $faker->unique()->isbn10, 11 | 'product_name' => $faker->name, 12 | 'common_id' => $common_id->random(), 13 | 'category_id' => $category_id->random(), 14 | 'product_price' => $faker->numberBetween($min = 1, $max = 1000), 15 | 'product_status' => $faker->boolean, 16 | 'product_or_item' => $faker->numberBetween($min = 0, $max = 2), 17 | 'manufacturer_id' => $manufacturer_id->random(), 18 | 'product_stock'=>0 19 | ]; 20 | }); 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | 'FORWARDED', 24 | Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', 25 | Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', 26 | Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', 27 | Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/button.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 |
4 | 5 | 6 | 15 | 16 |
7 | 8 | 9 | 12 | 13 |
10 | {{ $slot }} 11 |
14 |
17 |
20 | -------------------------------------------------------------------------------- /app/Services/Menu.php: -------------------------------------------------------------------------------- 1 | roles(); 18 | $perms = $roles->first()->permissions; 19 | $this->parent_menus = Permission::with(implode('.', array_fill(0, 4, 'children'))) 20 | ->where('parent_id', '=', '#') 21 | ->whereIn('id',$perms->pluck('id'))->get(); 22 | for($i=0; $iparent_menus); $i++){ 23 | $this->sub_menus[$i] = $this->parent_menus[$i]->children->wherein('id',$perms->pluck('id')); 24 | } 25 | // dd($this); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker $faker) { 17 | static $password; 18 | 19 | return [ 20 | 'name' => $faker->name, 21 | 'email' => $faker->unique()->safeEmail, 22 | 'password' => $password ?: $password = bcrypt('secret'), 23 | 'remember_token' => str_random(10), 24 | ]; 25 | }); 26 | -------------------------------------------------------------------------------- /database/seeds/UserTableSeeder.php: -------------------------------------------------------------------------------- 1 | first(); 18 | $super = new User(); 19 | $super->user_name = 'super'; 20 | $super->user_email = 'super@gmail.com'; 21 | $super->password = bcrypt('123456'); 22 | $super->user_addr = 'address'; 23 | $super->user_phone = '0912345678'; 24 | $super->user_status = 1; 25 | $super->user_birth = Carbon::parse('2000-01-01'); 26 | $super->save(); 27 | $super->roles()->attach($role_admin); 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /app/Permission.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Role::class); 21 | } 22 | 23 | public function permissions() 24 | { 25 | return $this->belongsToMany(Permission::class); 26 | } 27 | 28 | public function parent() 29 | { 30 | return $this->hasOne(Permission::class, 'id', 'parent_id'); 31 | } 32 | 33 | public function children() 34 | { 35 | return $this->hasMany(Permission::class, 'parent_id', 'id'); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /database/seeds/CompanyTableSeeder.php: -------------------------------------------------------------------------------- 1 | company_code = 'DEF'; 18 | $super->company_name = '預設(Default)'; 19 | $super->company_owner = 'ABC'; 20 | $super->company_phone = '0422222222'; 21 | $super->company_fax = '0411111111'; 22 | $super->company_email = 'default@gmail.com'; 23 | $super->company_url = 'www.default.com'; 24 | $super->company_ZipCode = '888'; 25 | $super->company_address = '台中市北區三民路1111號'; 26 | $super->company_GUInumber = '00000000'; 27 | 28 | $super->save(); 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 17 | @endif 18 | -------------------------------------------------------------------------------- /database/migrations/2017_12_26_033923_creat_product_categories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('category_name'); 19 | $table->string('parent_id')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('product_categories'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 | @if ($message = Session::get('success')) 6 |
7 |

{{ $message }}

8 |
9 | @endif 10 | 11 |
12 |
13 |
14 |
15 |
Dashboard
16 | 17 |
18 | @if (session('status')) 19 |
20 | {{ session('status') }} 21 |
22 | @endif 23 | You are logged in! 24 |
25 |
26 |
27 |
28 |
29 | @endsection 30 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | $this->load(__DIR__.'/Commands'); 39 | 40 | require base_path('routes/console.php'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; 21 | $font-family-sans-serif: "Raleway", sans-serif; 22 | $font-size-base: 14px; 23 | $line-height-base: 1.6; 24 | $text-color: #636b6f; 25 | 26 | // Navbar 27 | $navbar-default-bg: #fff; 28 | 29 | // Buttons 30 | $btn-default-color: $text-color; 31 | 32 | // Inputs 33 | $input-border: lighten($text-color, 40%); 34 | $input-border-focus: lighten($brand-primary, 25%); 35 | $input-color-placeholder: lighten($text-color, 30%); 36 | 37 | // Panels 38 | $panel-default-heading-bg: #fff; 39 | -------------------------------------------------------------------------------- /resources/views/product_categories/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

商品類別

7 |
8 |
9 | @permission('product_categories-create') 10 | 新增商品類別 11 | @endpermission 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | @each('product_categories.child', $product_categories, 'category') 28 |
商品類別Action
29 | {{-- {!! $permissions->render() !!}--}} 30 | @endsection -------------------------------------------------------------------------------- /database/migrations/2017_12_26_035009_creat_common_codes_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('code_name'); 19 | $table->string('parent_id')->nullable(); 20 | $table->integer('permission_id')->unsigned(); 21 | $table->foreign('permission_id')->references('id')->on('permissions') 22 | ->onUpdate('cascade')->onDelete('cascade'); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('common_codes'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('user_id'); 18 | $table->string('user_name'); 19 | $table->string('user_email')->unique(); 20 | $table->string('password'); 21 | $table->string('user_addr'); 22 | $table->char('user_phone',10); 23 | $table->boolean('user_status'); 24 | $table->date('user_birth'); 25 | $table->rememberToken(); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('users'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.17", 14 | "bootstrap-sass": "^3.3.7", 15 | "cross-env": "^5.1", 16 | "jquery": "^3.2", 17 | "laravel-mix": "^1.0", 18 | "lodash": "^4.17.4", 19 | "vue": "^2.5.7" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/views/permissions/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Show Permission

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | Name: 18 | {{ $permissions->display_name }} 19 |
20 |
21 |
22 |
23 | Description: 24 | {{ $permissions->description }} 25 |
26 |
27 |
28 |
29 | Route: 30 | {{ $permissions->route }} 31 |
32 |
33 |
34 | @endsection -------------------------------------------------------------------------------- /resources/views/product/child_select.blade.php: -------------------------------------------------------------------------------- 1 | 2 | {{-- @if(array_key_exists(0,$category))--}} 3 | {{--@if($category['category']->id == $category['parent_id'])--}} 4 | {{----}} 7 | {{--@else--}} 8 | {{----}} 11 | {{--@endif--}} 12 | {{--@else--}} 13 | 16 | {{--@endif--}} 17 | 18 | @if(count($category['childs'])>0) 19 | @foreach($category['childs'] as $category) 20 | @include('product_categories.child_select', ['category' => $category, 'i' => isset($i) ? $i : 1]) 21 | @endforeach 22 | @endif 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /resources/views/product_categories/child_select.blade.php: -------------------------------------------------------------------------------- 1 | 2 | {{-- @if(array_key_exists(0,$category))--}} 3 | {{--@if($category['category']->id == $category['parent_id'])--}} 4 | {{----}} 7 | {{--@else--}} 8 | {{----}} 11 | {{--@endif--}} 12 | {{--@else--}} 13 | 16 | {{--@endif--}} 17 | 18 | @if(count($category['childs'])>0) 19 | @foreach($category['childs'] as $category) 20 | @include('product_categories.child_select', ['category' => $category, 'i' => isset($i) ? $i : 1]) 21 | @endforeach 22 | @endif 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /database/migrations/2018_01_08_065945_creat_sale_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('sales_no',15)->unique(); 19 | $table->integer('customer_id')->unsigned(); 20 | $table->integer('user_id')->unsigned(); 21 | $table->boolean('sales_type'); 22 | $table->foreign('user_id')->references('user_id')->on('users') 23 | ->onUpdate('cascade')->onDelete('cascade'); 24 | $table->foreign('customer_id')->references('id')->on('customers') 25 | ->onUpdate('cascade')->onDelete('cascade'); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('sales'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | Build Status 5 | Total Downloads 6 | Latest Stable Version 7 | License 8 |

9 | 10 | ## Laravle-ERP 11 | Base on Laravel 5.5 12 | 13 | ### STEP 1. Git Clone 14 | > git clone https://github.com/RobinJian/laravel-ERP 15 | 16 | ### STEP 2. Get Into laravel-ERP 17 | >cd laravel-ERP 18 | 19 | ### STEP 3. Rebuild /vendor Direction 20 | >composer install 21 | 22 | ### STEP 4. Rebuild /node_modules Direction 23 | >npm install 24 | 25 | ### STEP 5. Rebuild .env 26 | >cp .env.example .env 27 | 28 | ### STEP 6. Create APP_KEY 29 | >php artisan key:generate 30 | 31 | ### STEP 7. Rebuild Database and Seeder 32 | >php artisan migrate:refresh --seed 33 | -------------------------------------------------------------------------------- /database/migrations/2017_12_17_080108_creat_companys_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('company_code',5)->unique(); 19 | $table->string('company_name'); 20 | $table->string('company_owner'); 21 | $table->char('company_phone',10); 22 | $table->char('company_fax',10); 23 | $table->string('company_ZipCode'); 24 | $table->string('company_email')->unique(); 25 | $table->string('company_url'); 26 | $table->string('company_address'); 27 | $table->string('company_GUInumber'); 28 | 29 | $table->timestamps(); 30 | }); 31 | } 32 | 33 | /** 34 | * Reverse the migrations. 35 | * 36 | * @return void 37 | */ 38 | public function down() 39 | { 40 | Schema::dropIfExists('companies'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/migrations/2018_01_04_154235_creat_purchase_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('purchases_no',15)->unique(); 19 | $table->integer('manufacturer_id')->unsigned(); 20 | $table->integer('user_id')->unsigned(); 21 | $table->boolean('purchases_type'); 22 | $table->foreign('user_id')->references('user_id')->on('users') 23 | ->onUpdate('cascade')->onDelete('cascade'); 24 | $table->foreign('manufacturer_id')->references('id')->on('manufacturers') 25 | ->onUpdate('cascade')->onDelete('cascade'); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('purchases'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2017_12_19_160045_creat_customer_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('customer_code',5)->unique(); 19 | $table->string('customer_name'); 20 | $table->string('customer_owner'); 21 | $table->char('customer_phone',10); 22 | $table->char('customer_fax',10); 23 | $table->string('customer_ZipCode'); 24 | $table->string('customer_email')->unique(); 25 | $table->string('customer_liaison'); 26 | $table->string('customer_address'); 27 | $table->string('customer_GUInumber'); 28 | 29 | $table->timestamps(); 30 | }); 31 | } 32 | 33 | /** 34 | * Reverse the migrations. 35 | * 36 | * @return void 37 | */ 38 | public function down() 39 | { 40 | Schema::dropIfExists('customers'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/views/commoncode/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

顯示共通代碼

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 代碼名稱: 18 | {{ $common->code_name }} 19 |
20 |
21 |
22 |
23 | 父類別: 24 | @if($common->parent_id=='#') 25 | # 26 | @else 27 | {{ $common->parent->code_name }} 28 | @endif
29 |
30 |
31 |
32 | 對應系統: 33 | {{ $common->permission->display_name }} 34 |
35 |
36 |
37 | @endsection 38 | -------------------------------------------------------------------------------- /database/migrations/2017_12_20_070714_creat_manufacturer_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('manufacturer_code',5)->unique(); 19 | $table->string('manufacturer_name'); 20 | $table->string('manufacturer_owner'); 21 | $table->char('manufacturer_phone',10); 22 | $table->char('manufacturer_fax',10); 23 | $table->string('manufacturer_ZipCode'); 24 | $table->string('manufacturer_email')->unique(); 25 | $table->string('manufacturer_liaison'); 26 | $table->string('manufacturer_address'); 27 | $table->string('manufacturer_GUInumber'); 28 | 29 | $table->timestamps(); 30 | }); 31 | } 32 | 33 | /** 34 | * Reverse the migrations. 35 | * 36 | * @return void 37 | */ 38 | public function down() 39 | { 40 | Schema::dropIfExists('manufacturers'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/views/vendor/notifications/email.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::message') 2 | {{-- Greeting --}} 3 | @if (! empty($greeting)) 4 | # {{ $greeting }} 5 | @else 6 | @if ($level == 'error') 7 | # Whoops! 8 | @else 9 | # Hello! 10 | @endif 11 | @endif 12 | 13 | {{-- Intro Lines --}} 14 | @foreach ($introLines as $line) 15 | {{ $line }} 16 | 17 | @endforeach 18 | 19 | {{-- Action Button --}} 20 | @isset($actionText) 21 | 33 | @component('mail::button', ['url' => $actionUrl, 'color' => $color]) 34 | {{ $actionText }} 35 | @endcomponent 36 | @endisset 37 | 38 | {{-- Outro Lines --}} 39 | @foreach ($outroLines as $line) 40 | {{ $line }} 41 | 42 | @endforeach 43 | 44 | {{-- Salutation --}} 45 | @if (! empty($salutation)) 46 | {{ $salutation }} 47 | @else 48 | Regards,
{{ config('app.name') }} 49 | @endif 50 | 51 | {{-- Subcopy --}} 52 | @isset($actionText) 53 | @component('mail::subcopy') 54 | If you’re having trouble clicking the "{{ $actionText }}" button, copy and paste the URL below 55 | into your web browser: [{{ $actionUrl }}]({{ $actionUrl }}) 56 | @endcomponent 57 | @endisset 58 | @endcomponent 59 | -------------------------------------------------------------------------------- /resources/views/users/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Show User

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | Name: 18 | {{ $user->user_name }} 19 |
20 |
21 |
22 |
23 | Email: 24 | {{ $user->user_email }} 25 |
26 |
27 |
28 |
29 | Roles: 30 | @if(!empty($user->roles)) 31 | @foreach($user->roles as $v) 32 | 33 | @endforeach 34 | @endif 35 |
36 |
37 |
38 | @endsection -------------------------------------------------------------------------------- /app/Product.php: -------------------------------------------------------------------------------- 1 | belongsToMany($this, 'bom', 'parent_id', 'child_id')->withPivot(['qty']); 17 | } 18 | 19 | public function bomRecursive() 20 | { 21 | return $this->bom()->with('bomRecursive'); 22 | } 23 | // public function bom_parent() 24 | // { 25 | // return $this->belongsToMany($this, 'bom', 'parent_id', 'child_id'); 26 | // } 27 | 28 | // public function bom_child() 29 | // { 30 | // return $this->belongsToMany($this, 'bom', 'child_id', 'parent_id')->withPivot(['qty']);; 31 | // } 32 | 33 | public function common_code() 34 | { 35 | return $this->belongsTo(Common_Code::class, 'common_id'); 36 | } 37 | 38 | public function product_category() 39 | { 40 | return $this->belongsTo(Product_Category::class, 'category_id'); 41 | } 42 | 43 | public function manufacturer() 44 | { 45 | return $this->belongsTo(Manufacturer::class, 'manufacturer_id'); 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /resources/views/roles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Show Role

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | Name: 18 | {{ $role->display_name }} 19 |
20 |
21 |
22 |
23 | Description: 24 | {{ $role->description }} 25 |
26 |
27 |
28 |
29 | Permissions: 30 | @if(!empty($rolePermissions)) 31 | @foreach($rolePermissions as $v) 32 | 33 | @endforeach 34 | @endif 35 |
36 |
37 |
38 | @endsection -------------------------------------------------------------------------------- /resources/views/vendor/pagination/default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 39 | } 40 | 41 | public function username() 42 | { 43 | return 'user_email'; 44 | } 45 | 46 | protected function credentials(Request $request) 47 | { 48 | return [ 49 | 'user_email' => $request->{$this->username()}, 50 | 'password' => $request->password, 51 | 'user_status' => 1, 52 | ]; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /database/migrations/2018_01_08_070007_creat_sale_details_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('sale_id')->unsigned(); 19 | $table->integer('sale_detail_no'); 20 | $table->integer('product_id')->unsigned(); 21 | // $table->integer('common_id')->unsigned(); 22 | $table->integer('sale_qty'); 23 | $table->integer('sale_price'); 24 | 25 | $table->foreign('sale_id')->references('id')->on('sales') 26 | ->onUpdate('cascade')->onDelete('cascade'); 27 | $table->foreign('product_id')->references('id')->on('products') 28 | ->onUpdate('cascade')->onDelete('cascade'); 29 | // $table->foreign('common_id')->references('id')->on('common_codes') 30 | // ->onUpdate('cascade')->onDelete('cascade'); 31 | $table->timestamps(); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::dropIfExists('sale_details'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | getStatusCode() == 403) { 53 | 54 | return redirect()->route('home'); 55 | } 56 | return parent::render($request, $exception); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /database/migrations/2018_01_04_155100_creat_purchase_detail_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('purchase_id')->unsigned(); 19 | $table->integer('purchase_detail_no'); 20 | $table->integer('product_id')->unsigned(); 21 | // $table->integer('common_id')->unsigned(); 22 | $table->integer('purchase_qty'); 23 | $table->integer('purchase_price'); 24 | 25 | $table->foreign('purchase_id')->references('id')->on('purchases') 26 | ->onUpdate('cascade')->onDelete('cascade'); 27 | $table->foreign('product_id')->references('id')->on('products') 28 | ->onUpdate('cascade')->onDelete('cascade'); 29 | // $table->foreign('common_id')->references('id')->on('common_codes') 30 | // ->onUpdate('cascade')->onDelete('cascade'); 31 | $table->timestamps(); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::dropIfExists('purchase_detail'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /resources/views/sale/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

銷貨維護

7 |
8 |
9 | {{--@permission('customer-create')--}} 10 | 新增銷貨單 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | @foreach ($sales as $key => $sale) 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | @endforeach 43 |
No銷貨單號客戶經辦人日期Action
{{ ++$i }}{{ $sale->sales_no }}{{ $sale->customer->customer_name }}{{ $sale->user->user_name }}{{ $sale->created_at }} 39 | 查看明細 40 |
44 | {!! $sales->render() !!} 45 | @endsection -------------------------------------------------------------------------------- /resources/views/sale_return/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

退貨處理

7 |
8 |
9 | {{--@permission('customer-create')--}} 10 | 新增銷貨退回單 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | @foreach ($sales as $key => $sale) 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | @endforeach 43 |
No銷貨單號客戶經辦人日期Action
{{ ++$i }}{{ $sale->sales_no }}{{ $sale->customer->customer_name }}{{ $sale->user->user_name }}{{ $sale->created_at }} 39 | 查看明細 40 |
44 | {!! $sales->render() !!} 45 | @endsection -------------------------------------------------------------------------------- /resources/views/vendor/pagination/semantic-ui.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /resources/views/purchase/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

進貨維護

7 |
8 |
9 | {{--@permission('customer-create')--}} 10 | 新增進貨單 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | @foreach ($purchases as $key => $purchase) 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | @endforeach 43 |
No進貨單號廠商經辦人日期Action
{{ ++$i }}{{ $purchase->purchases_no }}{{ $purchase->manufacturer->manufacturer_name }}{{ $purchase->user->user_name }}{{ $purchase->created_at }} 39 | 查看明細 40 |
44 | {!! $purchases->render() !!} 45 | @endsection -------------------------------------------------------------------------------- /resources/views/purchase_return/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

進貨退出維護

7 |
8 |
9 | {{--@permission('customer-create')--}} 10 | 新增進貨退出單 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | @foreach ($purchases as $key => $purchase) 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | @endforeach 43 |
No進貨退出單號廠商經辦人日期Action
{{ ++$i }}{{ $purchase->purchases_no }}{{ $purchase->manufacturer->manufacturer_name }}{{ $purchase->user->user_name }}{{ $purchase->created_at }} 39 | 查看明細 40 |
44 | {!! $purchases->render() !!} 45 | @endsection -------------------------------------------------------------------------------- /resources/views/vendor/pagination/bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=7.0.0", 9 | "fideloper/proxy": "~3.3", 10 | "laravel/framework": "5.5.*", 11 | "laravel/tinker": "~1.0", 12 | "laravelcollective/html": "~5.0", 13 | "zizaco/entrust": "5.2.x-dev" 14 | }, 15 | "require-dev": { 16 | "filp/whoops": "~2.0", 17 | "fzaninotto/faker": "~1.4", 18 | "mockery/mockery": "~1.0", 19 | "phpunit/phpunit": "~6.0" 20 | }, 21 | "autoload": { 22 | "classmap": [ 23 | "database/seeds", 24 | "database/factories" 25 | ], 26 | "psr-4": { 27 | "App\\": "app/" 28 | } 29 | }, 30 | "autoload-dev": { 31 | "psr-4": { 32 | "Tests\\": "tests/" 33 | } 34 | }, 35 | "extra": { 36 | "laravel": { 37 | "dont-discover": [ 38 | ] 39 | } 40 | }, 41 | "scripts": { 42 | "post-root-package-install": [ 43 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 44 | ], 45 | "post-create-project-cmd": [ 46 | "@php artisan key:generate" 47 | ], 48 | "post-autoload-dump": [ 49 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 50 | "@php artisan package:discover" 51 | ] 52 | }, 53 | "config": { 54 | "preferred-install": "dist", 55 | "sort-packages": true, 56 | "optimize-autoloader": true 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /resources/views/permissions/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Edit New Permission

8 |
9 |
10 | Back 11 |
12 |
13 |
14 | @if (count($errors) > 0) 15 |
16 | Whoops! There were some problems with your input.

17 | 22 |
23 | @endif 24 | {!! Form::model($permissions, ['method' => 'PATCH','route' => ['permissions.update', $permissions->id]]) !!} 25 |
26 |
27 |
28 | 權限名稱: 29 | {!! Form::text('display_name', null, array('placeholder' => 'Display_name','class' => 'form-control')) !!} 30 |
31 |
32 |
33 |
34 | 權限描述: 35 | {!! Form::text('description', null, array('placeholder' => 'Description','class' => 'form-control')) !!} 36 |
37 |
38 |
39 | 40 |
41 |
42 | {!! Form::close() !!} 43 | @endsection -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap-sass'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | window.axios = require('axios'); 23 | 24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Next we will register the CSRF Token as a common header with Axios so that 28 | * all outgoing HTTP requests automatically have it attached. This is just 29 | * a simple convenience so we don't have to attach every token manually. 30 | */ 31 | 32 | let token = document.head.querySelector('meta[name="csrf-token"]'); 33 | 34 | if (token) { 35 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 36 | } else { 37 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 38 | } 39 | 40 | /** 41 | * Echo exposes an expressive API for subscribing to channels and listening 42 | * for events that are broadcast by Laravel. Echo and event broadcasting 43 | * allows your team to easily build robust real-time web applications. 44 | */ 45 | 46 | // import Echo from 'laravel-echo' 47 | 48 | // window.Pusher = require('pusher-js'); 49 | 50 | // window.Echo = new Echo({ 51 | // broadcaster: 'pusher', 52 | // key: 'your-pusher-key' 53 | // }); 54 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /resources/views/permissions/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

Permission Management

7 |
8 |
9 | {{--@permission('permission-create')--}} 10 | {{-- Create New Permission--}} 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | + Expand All 22 | — Collapse All
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | @each('permissions.child', $categories, 'category') 32 |
NameDescriptionStatusAction
33 | 34 | 35 | 36 | 37 | {{-- --}} 38 | 39 | 49 | @endsection -------------------------------------------------------------------------------- /resources/views/commoncode/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

共通代碼管理

7 |
8 |
9 | {{--@permission('customer-create')--}} 10 | 新增共通代碼 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach ($commons as $key => $common) 31 | 32 | 33 | 34 | @if($common->parent_id=='#') 35 | 36 | @else 37 | 38 | @endif 39 | 40 | 46 | 47 | @endforeach 48 |
No代碼名稱父類別對應系統Action
{{ ++$i }}{{ $common->code_name }}#{{ $common->parent->code_name }}{{ $common->permission->display_name }} 41 | 顯示 42 | {{--@permission('company-edit')--}} 43 | 編輯 44 | {{--@endpermission--}} 45 |
49 | {!! $commons->render() !!} 50 | @endsection -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /resources/views/commoncode/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |
8 |

編輯共通代碼

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | @if (count($errors) > 0) 16 |
17 | Whoops! There were some problems with your input.

18 | 23 |
24 | @endif 25 | {!! Form::model($common, ['method' => 'PATCH','route' => ['commoncode.update', $common->id]]) !!} 26 |
27 |
28 |
29 | 代碼名稱: 30 | {!! Form::text('code_name', null, array('placeholder' => 'Code','class' => 'form-control')) !!} 31 |
32 |
33 |
34 |
35 | 父類別: 36 | {!! Form::select('parent', $parents,$common->parent_id) !!} 37 | 38 |
39 |
40 |
41 |
42 | 對應系統: 43 | {!! Form::select('permission', $permissions, $common->permission_id) !!} 44 |
45 |
46 | 47 | 48 |
49 | 50 |
51 |
52 | {!! Form::close() !!} 53 | @endsection -------------------------------------------------------------------------------- /resources/views/commoncode/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |
8 |

新增共通代碼

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | @if (count($errors) > 0) 16 |
17 | Whoops! There were some problems with your input.

18 | 23 |
24 | @endif 25 | {!! Form::open(array('route' => 'commoncode.store','method'=>'POST')) !!} 26 |
27 |
28 |
29 | 代碼名稱: 30 | {!! Form::text('code_name', null, array('placeholder' => 'Code','class' => 'form-control')) !!} 31 |
32 |
33 |
34 |
35 | 父類別: 36 | {!! Form::select('parent', $parents, array('class' => 'form-control','multiple')) !!} 37 | 38 |
39 |
40 |
41 |
42 | 對應系統: 43 | {!! Form::select('permission', $permissions, array('class' => 'form-control','multiple')) !!} 44 |
45 |
46 | 47 | 48 |
49 | 50 |
51 |
52 | {!! Form::close() !!} 53 | @endsection -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/layout.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 25 | 26 | 27 | 28 | 51 | 52 |
29 | 30 | {{ $header or '' }} 31 | 32 | 33 | 34 | 46 | 47 | 48 | {{ $footer or '' }} 49 |
35 | 36 | 37 | 38 | 43 | 44 |
39 | {{ Illuminate\Mail\Markdown::parse($slot) }} 40 | 41 | {{ $subcopy or '' }} 42 |
45 |
50 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 |
18 | {{ csrf_field() }} 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @if ($errors->has('email')) 27 | 28 | {{ $errors->first('email') }} 29 | 30 | @endif 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /public/js/checkbox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery littleTree 3 | * 4 | * @version 0.1 5 | * @author Mikahil Matyunin 6 | */ 7 | 8 | /** 9 | * 18 | * 19 | * Usage: 20 | * 21 | * $('ul#tree').checktree(); 22 | * 23 | */ 24 | 25 | (function($){ 26 | $.fn.extend({ 27 | 28 | checktree: function(){ 29 | $(this) 30 | .addClass('checktree-root') 31 | .on('change', 'input[type="checkbox"]', function(e){ 32 | e.stopPropagation(); 33 | e.preventDefault(); 34 | 35 | checkParents($(this)); 36 | checkChildren($(this)); 37 | }) 38 | ; 39 | 40 | var checkParents = function (c) 41 | { 42 | var parentLi = c.parents('ul:eq(0)').parents('li:eq(0)'); 43 | 44 | if (parentLi.length) 45 | { 46 | var siblingsChecked = parseInt($('input[type="checkbox"]:checked', c.parents('ul:eq(0)')).length), 47 | rootCheckbox = parentLi.find('input[type="checkbox"]:eq(0)') 48 | ; 49 | 50 | if (c.is(':checked')) 51 | rootCheckbox.prop('checked', true) 52 | else if (siblingsChecked === 0) 53 | rootCheckbox.prop('checked', false); 54 | 55 | checkParents(rootCheckbox); 56 | } 57 | } 58 | 59 | var checkChildren = function (c) 60 | { 61 | var childLi = $('ul li input[type="checkbox"]', c.parents('li:eq(0)')); 62 | 63 | if (childLi.length) 64 | childLi.prop('checked', c.is(':checked')); 65 | } 66 | } 67 | 68 | }); 69 | })(jQuery); 70 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Get a validator for an incoming registration request. 44 | * 45 | * @param array $data 46 | * @return \Illuminate\Contracts\Validation\Validator 47 | */ 48 | protected function validator(array $data) 49 | { 50 | return Validator::make($data, [ 51 | 'name' => 'required|string|max:255', 52 | 'email' => 'required|string|email|max:255|unique:users', 53 | 'password' => 'required|string|min:6|confirmed', 54 | ]); 55 | } 56 | 57 | /** 58 | * Create a new user instance after a valid registration. 59 | * 60 | * @param array $data 61 | * @return \App\User 62 | */ 63 | protected function create(array $data) 64 | { 65 | return User::create([ 66 | 'name' => $data['name'], 67 | 'email' => $data['email'], 68 | 'password' => bcrypt($data['password']), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /resources/views/users/edit_profile.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

更新個人資料

8 |
9 |
10 | Back 11 |
12 |
13 |
14 | @if (count($errors) > 0) 15 |
16 | Whoops! There were some problems with your input.

17 |
    18 | @foreach ($errors->all() as $error) 19 |
  • {{ $error }}
  • 20 | @endforeach 21 |
22 |
23 | @endif 24 | {!! Form::model($user, ['method' => 'POST','route' => ['users.update_profile']]) !!} 25 |
26 | {!! Form::hidden('user_id', null, array('placeholder' => 'Name','class' => 'form-control', 'hidden')) !!} 27 |
28 |
29 | Name: 30 | {!! Form::text('user_name', null, array('placeholder' => 'Name','class' => 'form-control')) !!} 31 |
32 |
33 |
34 |
35 | Address: 36 | {!! Form::text('user_addr', null, array('placeholder' => 'Address','class' => 'form-control')) !!} 37 |
38 |
39 |
40 |
41 | Phone: 42 | {!! Form::text('user_phone', null, array('placeholder' => 'Phone','class' => 'form-control')) !!} 43 |
44 |
45 |
46 | 47 |
48 |
49 | {!! Form::close() !!} 50 | @endsection -------------------------------------------------------------------------------- /resources/views/roles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

Role Management

7 |
8 |
9 | @permission('role-create') 10 | Create New Role 11 | @endpermission 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @foreach ($roles as $key => $role) 30 | 31 | 32 | 33 | 34 | 51 | 52 | @endforeach 53 |
NoNameDescriptionAction
{{ ++$i }}{{ $role->display_name }}{{ $role->description }} 35 | @permission('role-show') 36 | Show 37 | @endpermission 38 | @permission('role-edit') 39 | @if($role->id != 1) 40 | Edit 41 | @endif 42 | @endpermission 43 | @permission('role-delete') 44 | @if($role->id != 1) 45 | {!! Form::open(['method' => 'DELETE','route' => ['roles.destroy', $role->id],'style'=>'display:inline']) !!} 46 | {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!} 47 | {!! Form::close() !!} 48 | @endif 49 | @endpermission 50 |
54 | {!! $roles->render() !!} 55 | @endsection -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('home'); 22 | 23 | 24 | Route::group(['middleware' => ['auth']], function () { 25 | Route::resource('users', 'UserController'); 26 | Route::get('users/status/{status}/{id}', 'UserController@status')->name('users.status'); 27 | Route::get('users/profile/{id}', 'UserController@edit_profile')->name('users.edit_profile'); 28 | Route::post('users/update_profile', 'UserController@update_profile')->name('users.update_profile'); 29 | Route::resource('roles', 'RoleController'); 30 | Route::resource('permissions', 'PermissionController'); 31 | Route::get('permissions/status/{status}/{id}', 'PermissionController@status')->name('permissions.status'); 32 | Route::resource('company', 'CompanyController'); 33 | Route::resource('customer', 'CustomerController'); 34 | Route::resource('manufacturer', 'ManufacturerController'); 35 | Route::resource('commoncode', 'Common_CodeController'); 36 | Route::resource('product_categories', 'Product_CategoryController'); 37 | Route::resource('product', 'ProductController'); 38 | Route::get('product/status/{status}/{id}', 'ProductController@status')->name('product.status'); 39 | Route::resource('purchase', 'PurchaseController'); 40 | Route::post('purchase/manufacturer', 'PurchaseController@manufacturer')->name('purchase.manufacturer'); 41 | Route::resource('purchase_return', 'Purchases_ReturnController'); 42 | Route::post('purchase_return/manufacturer', 'Purchases_ReturnController@manufacturer')->name('purchase_return.manufacturer'); 43 | Route::resource('sale', 'SaleController'); 44 | Route::resource('sale_return', 'Sale_ReturnController'); 45 | 46 | 47 | 48 | }); 49 | 50 | -------------------------------------------------------------------------------- /resources/views/product/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

商品資料

7 |
8 |
9 | @permission('product-create') 10 | 新增商品 11 | @endpermission 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach ($products as $key => $product) 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 53 | 54 | @endforeach 55 |
No編號名稱價格供應商庫存Action
{{ ++$i }}{{ $product->product_code }}{{ $product->product_name }}{{ $product->product_price }}{{ $product->manufacturer->manufacturer_name }}{{ $product->product_stock }} 41 | Show 42 | @permission('product-edit') 43 | Edit 44 | @endpermission 45 | @permission('product_status') 46 | @if($product->product_status == 0) 47 | 啟用 48 | @else 49 | 禁用 50 | @endif 51 | @endpermission 52 |
56 | {!! $products->render() !!} 57 | @endsection -------------------------------------------------------------------------------- /resources/views/company/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

Company Management

7 |
8 |
9 | @permission('company-create') 10 | Create New Company 11 | @endpermission 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @foreach ($companys as $key => $company) 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | @endforeach 58 |
No代碼名稱負責人電話傳真Email網址郵遞區號地址統編Action
{{ ++$i }}{{ $company->company_code }}{{ $company->company_name }}{{ $company->company_owner }}{{ $company->company_phone }}{{ $company->company_fax }}{{ $company->company_email }}{{ $company->company_url }}{{ $company->company_ZipCode }}{{ $company->company_address }}{{ $company->company_GUInumber }} 51 | Show 52 | {{--@permission('company-edit')--}} 53 | Edit 54 | {{--@endpermission--}} 55 |
59 | {!! $companys->render() !!} 60 | @endsection -------------------------------------------------------------------------------- /database/migrations/2017_12_26_035014_creat_products_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('product_code',10)->unique(); 19 | $table->string('product_name'); 20 | $table->integer('common_id')->unsigned(); 21 | $table->integer('category_id')->unsigned(); 22 | $table->string('product_price'); 23 | $table->boolean('product_status'); 24 | $table->integer('product_or_item'); //成品=>0 半成品=>1 原料=>2 25 | $table->integer('manufacturer_id')->unsigned(); 26 | $table->integer('product_stock'); 27 | $table->foreign('common_id')->references('id')->on('common_codes') 28 | ->onUpdate('cascade')->onDelete('cascade'); 29 | $table->foreign('category_id')->references('id')->on('product_categories') 30 | ->onUpdate('cascade')->onDelete('cascade'); 31 | $table->foreign('manufacturer_id')->references('id')->on('manufacturers') 32 | ->onUpdate('cascade')->onDelete('cascade'); 33 | $table->timestamps(); 34 | }); 35 | 36 | Schema::create('bom', function (Blueprint $table){ 37 | $table->integer('parent_id')->unsigned(); 38 | $table->integer('child_id')->unsigned(); 39 | $table->integer('qty'); 40 | $table->foreign('parent_id')->references('id')->on('products') 41 | ->onUpdate('cascade')->onDelete('cascade'); 42 | $table->foreign('child_id')->references('id')->on('products') 43 | ->onUpdate('cascade')->onDelete('cascade'); 44 | $table->primary(['parent_id', 'child_id']); 45 | }); 46 | } 47 | 48 | /** 49 | * Reverse the migrations. 50 | * 51 | * @return void 52 | */ 53 | public function down() 54 | { 55 | Schema::dropIfExists('bom'); 56 | Schema::dropIfExists('products'); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | ], 65 | 66 | ], 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /resources/views/permissions/child.blade.php: -------------------------------------------------------------------------------- 1 | @if( $category['category']->parent_id=='#') 2 | {{----}} 3 | 4 | 5 | @else 6 | {{--@if(isset($i))--}} 7 | {{----}} 8 | {{--@else--}} 9 | 10 | 11 | {{-- --}} 12 | {{--@endif--}} 13 | @endif 14 | 15 | {{----}} 16 | 17 | {{ str_repeat(' |', isset($i) ? $i++ : 0) . $category['category']->display_name }} 18 | 19 | {{ $category['category']->description }} 20 | 21 | @if( $category['category']->status == 1) 22 | 顯示 23 | @else 24 | 不顯示 25 | @endif 26 | 27 | 28 | @permission('permission-show') 29 | Show 30 | @endpermission 31 | @permission('permission-edit') 32 | Edit 33 | @endpermission 34 | @permission('permission-status') 35 | @if( $category['category']->status == 0) 36 | 啟用 38 | @else 39 | 禁用 41 | @endif 42 | @endpermission 43 | 44 | 45 | @if(count($category['childs'])>0) 46 | @foreach($category['childs'] as $category) 47 | @include('permissions.child', ['category' => $category, 'i' => isset($i) ? $i : 1]) 48 | @endforeach 49 | @endif 50 | -------------------------------------------------------------------------------- /resources/views/customer/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

Customer Management

7 |
8 |
9 | {{--@permission('customer-create')--}} 10 | Create New Customer 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @foreach ($customers as $key => $customer) 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | @endforeach 58 |
No客戶編號名稱負責人聯絡人電話傳真Email郵遞區號地址統編Action
{{ ++$i }}{{ $customer->customer_code }}{{ $customer->customer_name }}{{ $customer->customer_owner }}{{ $customer->customer_liaison }}{{ $customer->customer_phone }}{{ $customer->customer_fax }}{{ $customer->customer_email }}{{ $customer->customer_ZipCode }}{{ $customer->customer_address }}{{ $customer->customer_GUInumber }} 51 | Show 52 | {{--@permission('company-edit')--}} 53 | Edit 54 | {{--@endpermission--}} 55 |
59 | {!! $customers->render() !!} 60 | @endsection -------------------------------------------------------------------------------- /mysql_function_query.txt: -------------------------------------------------------------------------------- 1 | DELIMITER $$ 2 | CREATE FUNCTION `permissions_connect_by_parent_eq_prior_id`(`value` INT) RETURNS int(11) 3 | READS SQL DATA 4 | BEGIN 5 | DECLARE _id INT; 6 | DECLARE _parent INT; 7 | DECLARE _next INT; 8 | DECLARE CONTINUE HANDLER FOR NOT FOUND SET @id = NULL; 9 | 10 | SET _parent = @id; 11 | SET _id = -1; 12 | 13 | IF @id IS NULL THEN 14 | RETURN NULL; 15 | END IF; 16 | 17 | LOOP 18 | SELECT MIN(id) 19 | INTO @id 20 | FROM permissions 21 | WHERE parent_id = _parent 22 | AND id > _id; 23 | IF @id IS NOT NULL OR _parent = @start_with THEN 24 | SET @level = @level + 1; 25 | RETURN @id; 26 | END IF; 27 | SET @level := @level - 1; 28 | SELECT id, parent_id 29 | INTO _id, _parent 30 | FROM permissions 31 | WHERE id = _parent; 32 | END LOOP; 33 | END$$ 34 | DELIMITER ; 35 | 36 | -------------------------------------------------------------------------------------------------------------------- 37 | 38 | DELIMITER $$ 39 | CREATE FUNCTION `product_categories_connect_by_parent_eq_prior_id`(`value` INT) RETURNS int(11) 40 | READS SQL DATA 41 | BEGIN 42 | DECLARE _id INT; 43 | DECLARE _parent INT; 44 | DECLARE _next INT; 45 | DECLARE CONTINUE HANDLER FOR NOT FOUND SET @id = NULL; 46 | 47 | SET _parent = @id; 48 | SET _id = -1; 49 | 50 | IF @id IS NULL THEN 51 | RETURN NULL; 52 | END IF; 53 | 54 | LOOP 55 | SELECT MIN(id) 56 | INTO @id 57 | FROM product_categories 58 | WHERE parent_id = _parent 59 | AND id > _id; 60 | IF @id IS NOT NULL OR _parent = @start_with THEN 61 | SET @level = @level + 1; 62 | RETURN @id; 63 | END IF; 64 | SET @level := @level - 1; 65 | SELECT id, parent_id 66 | INTO _id, _parent 67 | FROM product_categories 68 | WHERE id = _parent; 69 | END LOOP; 70 | END$$ 71 | DELIMITER ; -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 31 | \App\Http\Middleware\EncryptCookies::class, 32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 33 | \Illuminate\Session\Middleware\StartSession::class, 34 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 36 | \App\Http\Middleware\VerifyCsrfToken::class, 37 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 38 | ], 39 | 40 | 'api' => [ 41 | 'throttle:60,1', 42 | 'bindings', 43 | ], 44 | ]; 45 | 46 | /** 47 | * The application's route middleware. 48 | * 49 | * These middleware may be assigned to groups or used individually. 50 | * 51 | * @var array 52 | */ 53 | protected $routeMiddleware = [ 54 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 57 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 58 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 59 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 60 | 'role' => \Zizaco\Entrust\Middleware\EntrustRole::class, 61 | 'permission' => \Zizaco\Entrust\Middleware\EntrustPermission::class, 62 | 'ability' => \Zizaco\Entrust\Middleware\EntrustAbility::class, 63 | ]; 64 | } 65 | -------------------------------------------------------------------------------- /resources/views/manufacturer/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |

Manufacturer Management

7 |
8 |
9 | {{--@permission('customer-create')--}} 10 | Create New Manufacturer 11 | {{--@endpermission--}} 12 |
13 |
14 |
15 | 16 | @if ($message = Session::get('success')) 17 |
18 |

{{ $message }}

19 |
20 | @endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @foreach ($manufacturers as $key => $manufacturer) 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | @endforeach 58 |
No廠商編號名稱負責人聯絡人電話傳真Email郵遞區號地址統一編號Action
{{ ++$i }}{{ $manufacturer->manufacturer_code }}{{ $manufacturer->manufacturer_name }}{{ $manufacturer->manufacturer_owner }}{{ $manufacturer->manufacturer_liaison }}{{ $manufacturer->manufacturer_phone }}{{ $manufacturer->manufacturer_fax }}{{ $manufacturer->manufacturer_email }}{{ $manufacturer->manufacturer_ZipCode }}{{ $manufacturer->manufacturer_address }}{{ $manufacturer->manufacturer_GUInumber }} 51 | Show 52 | {{--@permission('company-edit')--}} 53 | Edit 54 | {{--@endpermission--}} 55 |
59 | {!! $manufacturers->render() !!} 60 | @endsection -------------------------------------------------------------------------------- /resources/views/product_categories/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |
8 |

新增商品類別

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | @if (count($errors) > 0) 17 |
18 | Whoops! There were some problems with your input.

19 |
    20 | @foreach ($errors->all() as $error) 21 |
  • {{ $error }}
  • 22 | @endforeach 23 |
24 |
25 | @endif 26 | 27 | {!! Form::open(array('route' => 'product_categories.store','method'=>'POST')) !!} 28 |
29 |
30 |
31 | 類別名稱: 32 | {!! Form::text('category_name', null, array('placeholder' => 'Category_Name','class' => 'form-control')) !!} 33 |
34 |
35 |
36 |
37 | 父類別: 38 | 41 |
42 |
43 |
44 |
45 | 隸屬類別: 46 | 49 |
50 |
51 |
52 | 53 |
54 |
55 | {!! Form::close() !!} 56 | 57 | @stop 58 | @section('js') 59 | 65 | @endsection -------------------------------------------------------------------------------- /resources/views/company/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Show Company

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 名稱: 18 | {{ $company->company_name }} 19 |
20 |
21 |
22 |
23 | 負責人: 24 | {{ $company->company_owner }} 25 |
26 |
27 |
28 |
29 | 電話: 30 | {{ $company->company_phone }} 31 |
32 |
33 |
34 |
35 | 傳真: 36 | {{ $company->company_fax }} 37 |
38 |
39 |
40 |
41 | Email: 42 | {{ $company->company_email }} 43 |
44 |
45 |
46 |
47 | 網址: 48 | {{ $company->company_url }} 49 |
50 |
51 |
52 |
53 | 郵遞區號: 54 | {{ $company->company_ZipCode }} 55 |
56 |
57 |
58 |
59 | 地址: 60 | {{ $company->company_address }} 61 |
62 |
63 |
64 |
65 | 統編: 66 | {{ $company->company_GUInumber }} 67 |
68 |
69 |
70 | @endsection 71 | -------------------------------------------------------------------------------- /resources/views/sale/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

銷貨資料

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 銷貨單號: 18 | {{ $sale->sales_no }} 19 |
20 |
21 |
22 | 23 |
24 | 客戶: 25 | {{$sale->customer->customer_name}} 26 |
27 |
28 |
29 |
30 | 經辦人: 31 | {{ $sale->user->user_name }} 32 |
33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | @foreach ($details as $key => $detail) 45 | 46 | 47 | 50 | 53 | 56 | 59 | 62 | 63 | 64 | @endforeach 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
No商品數量價錢小計
48 | {{$detail->sale_detail_no}} 49 | 51 | {{ $detail->product->product_name }} 52 | 54 | {{$detail->sale_qty}} 55 | 57 | {{$detail->sale_price}} 58 | 60 | {{$detail->sale_qty*$detail->sale_price}} 61 |
總計{{$total}}
76 | 77 |
78 |
79 | 80 | @endsection -------------------------------------------------------------------------------- /resources/views/sale_return/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

銷貨退回資料

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 銷貨單號: 18 | {{ $sale->sales_no }} 19 |
20 |
21 |
22 | 23 |
24 | 客戶: 25 | {{$sale->customer->customer_name}} 26 |
27 |
28 |
29 |
30 | 經辦人: 31 | {{ $sale->user->user_name }} 32 |
33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | @foreach ($details as $key => $detail) 45 | 46 | 47 | 50 | 53 | 56 | 59 | 62 | 63 | 64 | @endforeach 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
No商品數量價錢小計
48 | {{$detail->sale_detail_no}} 49 | 51 | {{ $detail->product->product_name }} 52 | 54 | {{$detail->sale_qty}} 55 | 57 | {{$detail->sale_price}} 58 | 60 | {{$detail->sale_qty*$detail->sale_price}} 61 |
總計{{$total}}
76 | 77 |
78 |
79 | 80 | @endsection -------------------------------------------------------------------------------- /resources/views/purchase/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

進貨資料

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 進貨單號: 18 | {{ $purchase->purchases_no }} 19 |
20 |
21 |
22 | 23 |
24 | 供應商: 25 | {{$purchase->manufacturer->manufacturer_name}} 26 |
27 |
28 |
29 |
30 | 經辦人: 31 | {{ $purchase->user->user_name }} 32 |
33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | @foreach ($details as $key => $detail) 45 | 46 | 47 | 50 | 53 | 56 | 59 | 62 | 63 | 64 | @endforeach 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
No商品數量價錢小計
48 | {{$detail->purchase_detail_no}} 49 | 51 | {{ $detail->product->product_name }} 52 | 54 | {{$detail->purchase_qty}} 55 | 57 | {{$detail->purchase_price}} 58 | 60 | {{$detail->purchase_qty*$detail->purchase_price}} 61 |
總計{{$total}}
76 | 77 |
78 |
79 | 80 | @endsection -------------------------------------------------------------------------------- /resources/views/purchase_return/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

進貨退出資料

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 退貨單號: 18 | {{ $purchase->purchases_no }} 19 |
20 |
21 |
22 | 23 |
24 | 供應商: 25 | {{$purchase->manufacturer->manufacturer_name}} 26 |
27 |
28 |
29 |
30 | 經辦人: 31 | {{ $purchase->user->user_name }} 32 |
33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | @foreach ($details as $key => $detail) 45 | 46 | 47 | 50 | 53 | 56 | 59 | 62 | 63 | 64 | @endforeach 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
No商品數量價錢小計
48 | {{$detail->purchase_detail_no}} 49 | 51 | {{ $detail->product->product_name }} 52 | 54 | {{$detail->purchase_qty}} 55 | 57 | {{$detail->purchase_price}} 58 | 60 | {{$detail->purchase_qty*$detail->purchase_price}} 61 |
總計{{$total}}
76 | 77 |
78 |
79 | 80 | @endsection -------------------------------------------------------------------------------- /config/trustedproxy.php: -------------------------------------------------------------------------------- 1 | getClientIp() 23 | * always gets the originating client IP, no matter 24 | * how many proxies that client's request has 25 | * subsequently passed through. 26 | */ 27 | 'proxies' => [ 28 | '192.168.1.10', 29 | ], 30 | 31 | /* 32 | * Or, to trust all proxies that connect 33 | * directly to your server, uncomment this: 34 | */ 35 | # 'proxies' => '*', 36 | 37 | /* 38 | * Or, to trust ALL proxies, including those that 39 | * are in a chain of forwarding, uncomment this: 40 | */ 41 | # 'proxies' => '**', 42 | 43 | /* 44 | * Default Header Names 45 | * 46 | * Change these if the proxy does 47 | * not send the default header names. 48 | * 49 | * Note that headers such as X-Forwarded-For 50 | * are transformed to HTTP_X_FORWARDED_FOR format. 51 | * 52 | * The following are Symfony defaults, found in 53 | * \Symfony\Component\HttpFoundation\Request::$trustedHeaders 54 | * 55 | * You may optionally set headers to 'null' here if you'd like 56 | * for them to be considered untrusted instead. Ex: 57 | * 58 | * Illuminate\Http\Request::HEADER_CLIENT_HOST => null, 59 | * 60 | * WARNING: If you're using AWS Elastic Load Balancing or Heroku, 61 | * the FORWARDED and X_FORWARDED_HOST headers should be set to null 62 | * as they are currently unsupported there. 63 | */ 64 | 'headers' => [ 65 | (defined('Illuminate\Http\Request::HEADER_FORWARDED') ? Illuminate\Http\Request::HEADER_FORWARDED : 'forwarded') => 'FORWARDED', 66 | Illuminate\Http\Request::HEADER_CLIENT_IP => 'X_FORWARDED_FOR', 67 | Illuminate\Http\Request::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST', 68 | Illuminate\Http\Request::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO', 69 | Illuminate\Http\Request::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT', 70 | ] 71 | ]; 72 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /resources/views/customer/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Show Customer

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 客戶編號: 18 | {{ $customer->customer_code }} 19 |
20 |
21 |
22 |
23 | 名稱: 24 | {{ $customer->customer_name }} 25 |
26 |
27 |
28 |
29 | 負責人: 30 | {{ $customer->customer_owner }} 31 |
32 |
33 |
34 |
35 | 聯絡人: 36 | {{ $customer->customer_liaison }} 37 |
38 |
39 |
40 |
41 | 電話: 42 | {{ $customer->customer_phone }} 43 |
44 |
45 |
46 |
47 | 傳真: 48 | {{ $customer->customer_fax }} 49 |
50 |
51 |
52 |
53 | Email: 54 | {{ $customer->customer_email }} 55 |
56 |
57 |
58 |
59 | 郵遞區號: 60 | {{ $customer->customer_ZipCode }} 61 |
62 |
63 |
64 |
65 | 地址: 66 | {{ $customer->customer_address }} 67 |
68 |
69 |
70 |
71 | 統一編號: 72 | {{ $customer->customer_GUInumber }} 73 |
74 |
75 |
76 | @endsection 77 | -------------------------------------------------------------------------------- /public/css/jquery.appendGrid-1.7.1.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery appendGrid v1.7.1 3 | * https://appendgrid.apphb.com/ 4 | * 5 | * Copyright 2017 Albert L. 6 | * Dual licensed under the LGPL (http://www.gnu.org/licenses/lgpl.html) 7 | * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. 8 | * 9 | * Depends: 10 | * jQuery v1.12.4+ 11 | * jQuery UI v1.12.1+ 12 | */ 13 | div.appendGrid 14 | { 15 | } 16 | div.appendGrid table.head, 17 | div.appendGrid table.body, 18 | div.appendGrid table.foot 19 | { 20 | border-collapse: collapse; 21 | width: auto; 22 | } 23 | div.appendGrid table.head thead tr.columnHead td 24 | { 25 | width: auto; 26 | text-overflow: ellipsis; 27 | } 28 | div.appendGrid table td 29 | { 30 | padding: 1px; 31 | } 32 | div.appendGrid table.head thead td 33 | { 34 | padding-top: 4px; 35 | padding-bottom: 4px; 36 | white-space: nowrap; 37 | } 38 | div.appendGrid table thead td.caption 39 | { 40 | padding: 4px; 41 | font-weight: bold; 42 | } 43 | div.appendGrid table tbody input[type=text] 44 | { 45 | width: 100%; 46 | box-sizing: border-box; 47 | -webkit-box-sizing: border-box; 48 | -moz-box-sizing: border-box; 49 | } 50 | div.appendGrid table tbody td 51 | { 52 | white-space: pre-wrap; 53 | } 54 | div.appendGrid table td.first 55 | { 56 | text-align: center; 57 | vertical-align: middle; 58 | min-width: 32px; 59 | } 60 | div.appendGrid table td.last 61 | { 62 | text-align: center; 63 | vertical-align: middle; 64 | white-space: nowrap; 65 | min-width: 91px; 66 | } 67 | div.appendGrid table tbody td.last button 68 | { 69 | min-height: 20px; 70 | margin: 1px; 71 | } 72 | div.appendGrid table tbody td.last button.insert, 73 | div.appendGrid table tbody td.last button.remove, 74 | div.appendGrid table tbody td.last button.moveUp, 75 | div.appendGrid table tbody td.last button.moveDown 76 | { 77 | height: 24px; 78 | width: 20px; 79 | } 80 | div.appendGrid table tbody td.last div.rowDrag 81 | { 82 | display: inline-block; 83 | vertical-align: middle; 84 | width: 18px; 85 | height: 18px; 86 | margin: 1px; 87 | } 88 | div.appendGrid table tfoot button 89 | { 90 | min-height: 24px; 91 | min-width: 28px; 92 | } 93 | div.appendGrid table tfoot button.append, 94 | div.appendGrid table tfoot button.removeLast 95 | { 96 | height: 24px; 97 | min-width: 28px; 98 | } 99 | div.appendGrid table input.double 100 | { 101 | text-align: right; 102 | } 103 | div.appendGrid table tbody tr.empty td 104 | { 105 | text-align: center; 106 | } 107 | div.appendGrid table td.invisible 108 | { 109 | display: none; 110 | } 111 | div.appendGrid table thead td.resizable 112 | { 113 | } 114 | div.appendGrid div.scroller 115 | { 116 | overflow: auto; 117 | display: block; 118 | padding: 0px; 119 | margin: 0px; 120 | } -------------------------------------------------------------------------------- /resources/views/manufacturer/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Show Manufacturer

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 廠商編號: 18 | {{ $manufacturer->manufacturer_code }} 19 |
20 |
21 |
22 |
23 | 名稱: 24 | {{ $manufacturer->manufacturer_name }} 25 |
26 |
27 |
28 |
29 | 負責人: 30 | {{ $manufacturer->manufacturer_owner }} 31 |
32 |
33 |
34 |
35 | 聯絡人: 36 | {{ $manufacturer->manufacturer_liaison }} 37 |
38 |
39 |
40 |
41 | 電話: 42 | {{ $manufacturer->manufacturer_phone }} 43 |
44 |
45 |
46 |
47 | 傳真: 48 | {{ $manufacturer->manufacturer_fax }} 49 |
50 |
51 |
52 |
53 | Email: 54 | {{ $manufacturer->manufacturer_email }} 55 |
56 |
57 |
58 |
59 | 郵遞區號: 60 | {{ $manufacturer->manufacturer_ZipCode }} 61 |
62 |
63 |
64 |
65 | 地址: 66 | {{ $manufacturer->manufacturer_address }} 67 |
68 |
69 |
70 |
71 | 統一編號: 72 | {{ $manufacturer->manufacturer_GUInumber }} 73 |
74 |
75 |
76 | @endsection 77 | -------------------------------------------------------------------------------- /database/migrations/2017_12_14_135113_entrust_setup_tables.php: -------------------------------------------------------------------------------- 1 | increments('id'); 19 | $table->string('name')->unique(); 20 | $table->string('display_name')->nullable(); 21 | $table->string('description')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | 25 | // Create table for associating roles to users (Many-to-Many) 26 | Schema::create('role_user', function (Blueprint $table) { 27 | $table->integer('user_id')->unsigned(); 28 | $table->integer('role_id')->unsigned(); 29 | 30 | $table->foreign('user_id')->references('user_id')->on('users') 31 | ->onUpdate('cascade')->onDelete('cascade'); 32 | $table->foreign('role_id')->references('id')->on('roles') 33 | ->onUpdate('cascade')->onDelete('cascade'); 34 | 35 | $table->primary(['user_id', 'role_id']); 36 | }); 37 | 38 | // Create table for storing permissions 39 | Schema::create('permissions', function (Blueprint $table) { 40 | $table->increments('id'); 41 | $table->string('name')->unique(); 42 | $table->string('parent_id')->nullable(); 43 | $table->string('display_name')->nullable(); 44 | $table->string('description')->nullable(); 45 | $table->integer('status')->nullable(); 46 | $table->string('route')->nullable(); 47 | $table->timestamps(); 48 | }); 49 | 50 | // Create table for associating permissions to roles (Many-to-Many) 51 | Schema::create('permission_role', function (Blueprint $table) { 52 | $table->integer('permission_id')->unsigned(); 53 | $table->integer('role_id')->unsigned(); 54 | 55 | $table->foreign('permission_id')->references('id')->on('permissions') 56 | ->onUpdate('cascade')->onDelete('cascade'); 57 | $table->foreign('role_id')->references('id')->on('roles') 58 | ->onUpdate('cascade')->onDelete('cascade'); 59 | 60 | $table->primary(['permission_id', 'role_id']); 61 | }); 62 | 63 | DB::commit(); 64 | } 65 | 66 | /** 67 | * Reverse the migrations. 68 | * 69 | * @return void 70 | */ 71 | public function down() 72 | { 73 | Schema::drop('permission_role'); 74 | Schema::drop('permissions'); 75 | Schema::drop('role_user'); 76 | Schema::drop('roles'); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /resources/views/users/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Edit New User

8 |
9 |
10 | Back 11 |
12 |
13 |
14 | @if (count($errors) > 0) 15 |
16 | Whoops! There were some problems with your input.

17 |
    18 | @foreach ($errors->all() as $error) 19 |
  • {{ $error }}
  • 20 | @endforeach 21 |
22 |
23 | @endif 24 | {!! Form::model($user, ['method' => 'PATCH','route' => ['users.update', $user->user_id]]) !!} 25 |
26 |
27 |
28 | Name: 29 | {!! Form::text('user_name', null, array('placeholder' => 'Name','class' => 'form-control')) !!} 30 |
31 |
32 |
33 |
34 | Birthday: 35 | {!! Form::date('user_birth', null, array('placeholder' => 'Birth','class' => 'form-control')) !!} 36 |
37 |
38 |
39 |
40 | Email: 41 | {!! Form::text('user_email', null, array('placeholder' => 'Email','class' => 'form-control')) !!} 42 |
43 |
44 |
45 |
46 | Address: 47 | {!! Form::text('user_addr', null, array('placeholder' => 'Address','class' => 'form-control')) !!} 48 |
49 |
50 |
51 |
52 | Phone: 53 | {!! Form::text('user_phone', null, array('placeholder' => 'Phone','class' => 'form-control')) !!} 54 |
55 |
56 |
57 |
58 | Role: 59 | {!! Form::select('roles[]', $roles,$userRole, array('class' => 'form-control','multiple')) !!} 60 |
61 |
62 |
63 | 64 |
65 |
66 | {!! Form::close() !!} 67 | @endsection -------------------------------------------------------------------------------- /resources/views/product/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

商品資料

8 |
9 |
10 | Back 11 |
12 |
13 |
14 |
15 |
16 |
17 | 商品編號: 18 | {{ $product->product_code }} 19 |
20 |
21 |
22 |
23 | 商品名稱: 24 | {{ $product->product_name }} 25 |
26 |
27 |
28 |
29 | 商品類別: 30 | {{$product->product_category->category_name}} 31 |
32 |
33 |
34 |
35 | 商品定位: 36 | @if($product->product_or_item == 0 ) 37 | 成品 38 | @elseif($product->product_or_item == 1) 39 | 半成品 40 | @else 41 | 原料 42 | @endif 43 |
44 |
45 |
46 |
47 | 商品價格: 48 | {{$product->product_price}} 49 |
50 |
51 |
52 |
53 | 通用碼: 54 | {{$product->common_code->code_name}} 55 |
56 |
57 |
58 |
59 | 供應商: 60 | {{$product->manufacturer->manufacturer_name}} 61 |
62 |
63 |
64 |
65 | 商品狀態: 66 | @if($product->product_status == 1) 67 | 上架 68 | @else 69 | 下架 70 | @endif 71 |
72 |
73 |
74 | 物料清單 75 | 76 | 77 | 78 | 79 | 80 | @each('product.child', $product_table, 'product_table') 81 |
物料名稱數量
82 |
83 |
84 | @endsection -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache/data'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => env( 90 | 'CACHE_PREFIX', 91 | str_slug(env('APP_NAME', 'laravel'), '_').'_cache' 92 | ), 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 77 | @endif 78 | 79 |
80 |
81 | Laravel 82 |
83 | 84 | 91 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /resources/views/product_categories/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |
8 |

新增商品類別

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | @if (count($errors) > 0) 17 |
18 | Whoops! There were some problems with your input.

19 |
    20 | @foreach ($errors->all() as $error) 21 |
  • {{ $error }}
  • 22 | @endforeach 23 |
24 |
25 | @endif 26 | 27 | {!! Form::model($categories, ['method' => 'PATCH','route' => ['product_categories.update', $categories->id]]) !!} 28 |
29 |
30 |
31 | 類別名稱: 32 | {!! Form::text('category_name', null, array('placeholder' => 'Category_Name','class' => 'form-control')) !!} 33 |
34 |
35 |
36 |
37 | 父類別: 38 | 45 |
46 |
47 |
48 |
49 | 隸屬類別: 50 | 54 |
55 |
56 |
57 | 58 |
59 |
60 | {!! Form::close() !!} 61 | 62 | @stop 63 | @section('js') 64 | 77 | @endsection -------------------------------------------------------------------------------- /resources/views/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | 5 | @section('content') 6 | 7 |
8 |
9 |
10 |

Users Management

11 |
12 |
13 | Create New User 14 |
15 |
16 |
17 | 18 | @if ($message = Session::get('success')) 19 |
20 |

{{ $message }}

21 |
22 | @endif 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | @foreach ($data as $key => $user) 34 | 35 | 36 | 37 | 38 | 45 | 52 | 74 | 75 | @endforeach 76 |
NoNameEmailRolesStatusAction
{{ ++$i }}{{ $user->user_name }}{{ $user->user_email }} 39 | @if(!empty($user->roles)) 40 | @foreach($user->roles as $v) 41 | 42 | @endforeach 43 | @endif 44 | 46 | @if($user->user_status == 1) 47 | 顯示 48 | @else 49 | 不顯示 50 | @endif 51 | 53 | @permission('user-show') 54 | Show 55 | @endpermission 56 | @permission('user-edit') 57 | @if($user->user_id != 1) 58 | Edit 59 | @endif 60 | @endpermission 61 | @permission('user-status') 62 | @if($user->user_status == 0) 63 | 啟用 64 | @else 65 | 禁用 66 | @endif 67 | @endpermission 68 | @permission('user-delete') 69 | {!! Form::open(['method' => 'DELETE','route' => ['users.destroy', $user->user_id],'style'=>'display:inline']) !!} 70 | {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!} 71 | {!! Form::close() !!} 72 | @endpermission 73 |
77 | {!! $data->render() !!} 78 | 79 | @endsection -------------------------------------------------------------------------------- /resources/views/users/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |
8 |

Create New User

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | @if (count($errors) > 0) 16 |
17 | Whoops! There were some problems with your input.

18 |
    19 | @foreach ($errors->all() as $error) 20 |
  • {{ $error }}
  • 21 | @endforeach 22 |
23 |
24 | @endif 25 | {!! Form::open(array('route' => 'users.store','method'=>'POST')) !!} 26 |
27 |
28 |
29 | Name: 30 | {!! Form::text('user_name', null, array('placeholder' => 'Name','class' => 'form-control')) !!} 31 |
32 |
33 |
34 |
35 | Birthday: 36 | {!! Form::date('user_birth', null, array('placeholder' => 'Birth','class' => 'form-control')) !!} 37 |
38 |
39 |
40 |
41 | Email: 42 | {!! Form::text('user_email', null, array('placeholder' => 'Email','class' => 'form-control')) !!} 43 |
44 |
45 |
46 |
47 | Address: 48 | {!! Form::text('user_addr', null, array('placeholder' => 'Address','class' => 'form-control')) !!} 49 |
50 |
51 |
52 |
53 | Phone: 54 | {!! Form::text('user_phone', null, array('placeholder' => 'Phone','class' => 'form-control')) !!} 55 |
56 |
57 |
58 |
59 | 開通帳號: 60 | 63 |
64 |
65 |
66 |
67 | Role: 68 | {!! Form::select('roles[]', $roles,[], array('class' => 'form-control','multiple')) !!} 69 |
70 |
71 |
72 | 73 |
74 |
75 | {!! Form::close() !!} 76 | @endsection --------------------------------------------------------------------------------