Skip to content

Commit a119996

Browse files
committed
my first commit
1 parent 7b92129 commit a119996

File tree

108 files changed

+10451
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+10451
-1
lines changed

Diff for: .gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@ Homestead.yaml
2121
Homestead.json
2222
/.vagrant
2323
.phpunit.result.cache
24+
25+
# OS X
26+
.DS_Store
27+
.AppleDouble
28+
.LSOverride
29+
30+
# JETBRAINS IDEs
31+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
32+
.idea/

Diff for: README.md

+61-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,61 @@
1-
# laravelcourse
1+
<p align="center"><img src="https://res.cloudinary.com/dtfbvvkyp/image/upload/v1566331377/laravel-logolockup-cmyk-red.svg" width="400"></p>
2+
3+
<p align="center">
4+
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
5+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
6+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
7+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
8+
</p>
9+
10+
## About Laravel
11+
12+
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13+
14+
- [Simple, fast routing engine](https://laravel.com/docs/routing).
15+
- [Powerful dependency injection container](https://laravel.com/docs/container).
16+
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17+
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18+
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19+
- [Robust background job processing](https://laravel.com/docs/queues).
20+
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21+
22+
Laravel is accessible, powerful, and provides tools required for large, robust applications.
23+
24+
## Learning Laravel
25+
26+
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27+
28+
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
29+
30+
## Laravel Sponsors
31+
32+
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
33+
34+
### Premium Partners
35+
36+
- **[Vehikl](https://vehikl.com/)**
37+
- **[Tighten Co.](https://tighten.co)**
38+
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
39+
- **[64 Robots](https://64robots.com)**
40+
- **[Cubet Techno Labs](https://cubettech.com)**
41+
- **[Cyber-Duck](https://cyber-duck.co.uk)**
42+
- **[Many](https://www.many.co.uk)**
43+
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
44+
- **[DevSquad](https://devsquad.com)**
45+
- **[OP.GG](https://op.gg)**
46+
47+
## Contributing
48+
49+
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
50+
51+
## Code of Conduct
52+
53+
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
54+
55+
## Security Vulnerabilities
56+
57+
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed.
58+
59+
## License
60+
61+
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Diff for: app/Comment.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
4+
namespace App;
5+
6+
use Illuminate\Database\Eloquent\Model;
7+
use App\Product;
8+
9+
class Comment extends Model
10+
{
11+
//attributes id, description, product_id, created_at, updated_at
12+
protected $fillable = ['description', 'product_id'];
13+
14+
public function getId()
15+
{
16+
return $this->attributes['id'];
17+
}
18+
19+
public function setId($id)
20+
{
21+
$this->attributes['id'] = $id;
22+
}
23+
24+
public function getDescription()
25+
{
26+
return $this->attributes['description'];
27+
}
28+
29+
public function setDescription($desc)
30+
{
31+
$this->attributes['description'] = $desc;
32+
}
33+
34+
public function getProductId()
35+
{
36+
return $this->attributes['product_id'];
37+
}
38+
39+
public function setProductId($pId)
40+
{
41+
$this->attributes['product_id'] = $pId;
42+
}
43+
44+
public function product(){
45+
return $this->belongsTo(Product::class);
46+
}
47+
}
48+

Diff for: app/Console/Kernel.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
//
17+
];
18+
19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
// $schedule->command('inspire')->hourly();
28+
}
29+
30+
/**
31+
* Register the commands for the application.
32+
*
33+
* @return void
34+
*/
35+
protected function commands()
36+
{
37+
$this->load(__DIR__.'/Commands');
38+
39+
require base_path('routes/console.php');
40+
}
41+
}

Diff for: app/Exceptions/Handler.php

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6+
use Throwable;
7+
8+
class Handler extends ExceptionHandler
9+
{
10+
/**
11+
* A list of the exception types that are not reported.
12+
*
13+
* @var array
14+
*/
15+
protected $dontReport = [
16+
//
17+
];
18+
19+
/**
20+
* A list of the inputs that are never flashed for validation exceptions.
21+
*
22+
* @var array
23+
*/
24+
protected $dontFlash = [
25+
'password',
26+
'password_confirmation',
27+
];
28+
29+
/**
30+
* Report or log an exception.
31+
*
32+
* @param \Throwable $exception
33+
* @return void
34+
*
35+
* @throws \Exception
36+
*/
37+
public function report(Throwable $exception)
38+
{
39+
parent::report($exception);
40+
}
41+
42+
/**
43+
* Render an exception into an HTTP response.
44+
*
45+
* @param \Illuminate\Http\Request $request
46+
* @param \Throwable $exception
47+
* @return \Symfony\Component\HttpFoundation\Response
48+
*
49+
* @throws \Throwable
50+
*/
51+
public function render($request, Throwable $exception)
52+
{
53+
return parent::render($request, $exception);
54+
}
55+
}

Diff for: app/Http/Controllers/Api/ProductApi.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
4+
namespace App\Http\Controllers\Api;
5+
6+
use App\Http\Controllers\Controller;
7+
use Illuminate\Http\Request;
8+
use App\Product;
9+
10+
class ProductApi extends Controller
11+
{
12+
public function index()
13+
{
14+
return Product::all();
15+
}
16+
17+
public function show($id)
18+
{
19+
return Product::findOrFail($id);
20+
}
21+
}

Diff for: app/Http/Controllers/Api/ProductApiV2.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Api;
4+
5+
use App\Http\Resources\ProductResource;
6+
use App\Http\Controllers\Controller;
7+
use Illuminate\Http\Request;
8+
use App\Product;
9+
10+
class ProductApiV2 extends Controller
11+
{
12+
public function index()
13+
{
14+
return ProductResource::collection(Product::all());
15+
}
16+
17+
public function show($id)
18+
{
19+
return new ProductResource(Product::findOrFail($id));
20+
}
21+
}

Diff for: app/Http/Controllers/Api/ProductApiV3.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
4+
namespace App\Http\Controllers\Api;
5+
6+
use \App\Http\Controllers\Controller;
7+
use App\Http\Resources\ProductCollection;
8+
use App\Http\Resources\ProductResource;
9+
use Illuminate\Http\Request;
10+
use App\Product;
11+
12+
13+
class ProductApiV3 extends Controller
14+
{
15+
public function index()
16+
{
17+
return new ProductCollection(ProductResource::collection(Product::all()));
18+
}
19+
20+
public function paginate()
21+
{
22+
return new ProductCollection(ProductResource::collection(Product::paginate(5)));
23+
}
24+
25+
}

Diff for: app/Http/Controllers/Controller.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6+
use Illuminate\Foundation\Bus\DispatchesJobs;
7+
use Illuminate\Foundation\Validation\ValidatesRequests;
8+
use Illuminate\Routing\Controller as BaseController;
9+
10+
class Controller extends BaseController
11+
{
12+
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
13+
}

Diff for: app/Http/Controllers/HomeController.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
class HomeController extends Controller
6+
{
7+
8+
public function index(){
9+
return view('home.index');
10+
}
11+
12+
public function show(){
13+
return view('contact.index');
14+
}
15+
16+
}

Diff for: app/Http/Controllers/ImageController.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
use App\Interfaces\ImageStorage;
7+
8+
class ImageController extends Controller
9+
{
10+
public function index(){
11+
return view("image/index");
12+
}
13+
14+
public function save(Request $request){
15+
$storeInterface = app(ImageStorage::class);
16+
$storeInterface->store($request);
17+
return back()->with('success','Image uploaded successfully!');
18+
}
19+
}
20+

Diff for: app/Http/Controllers/ImageNotDIController.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
use App\Util\ImageLocalStorage;
7+
8+
class ImageNotDIController extends Controller
9+
{
10+
public function index(){
11+
return view("imagenotdi/index");
12+
}
13+
14+
public function save(Request $request){
15+
$storeImageLocal = new ImageLocalStorage();
16+
$storeImageLocal->store($request);
17+
return back()->with('success','Image uploaded successfully!');
18+
}
19+
}
20+

0 commit comments

Comments
 (0)