Skip to content

Commit ffbf833

Browse files
committed
new crud
1 parent 58b8365 commit ffbf833

File tree

118 files changed

+5155
-1525
lines changed

Some content is hidden

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

118 files changed

+5155
-1525
lines changed

.env.example

+33-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
1-
APP_NAME=Lumen
1+
APP_NAME=Laravel
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
55
APP_URL=http://localhost
6-
APP_TIMEZONE=UTC
76

87
LOG_CHANNEL=stack
9-
LOG_SLACK_WEBHOOK_URL=
108

119
DB_CONNECTION=mysql
1210
DB_HOST=127.0.0.1
1311
DB_PORT=3306
14-
DB_DATABASE=homestead
15-
DB_USERNAME=homestead
16-
DB_PASSWORD=secret
12+
DB_DATABASE=laravel
13+
DB_USERNAME=root
14+
DB_PASSWORD=
1715

16+
BROADCAST_DRIVER=log
1817
CACHE_DRIVER=file
1918
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
SESSION_LIFETIME=120
21+
22+
REDIS_HOST=127.0.0.1
23+
REDIS_PASSWORD=null
24+
REDIS_PORT=6379
25+
26+
MAIL_MAILER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
MAIL_FROM_ADDRESS=null
33+
MAIL_FROM_NAME="${APP_NAME}"
34+
35+
AWS_ACCESS_KEY_ID=
36+
AWS_SECRET_ACCESS_KEY=
37+
AWS_DEFAULT_REGION=us-east-1
38+
AWS_BUCKET=
39+
40+
PUSHER_APP_ID=
41+
PUSHER_APP_KEY=
42+
PUSHER_APP_SECRET=
43+
PUSHER_APP_CLUSTER=mt1
44+
45+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
46+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/storage/*.key
15
/vendor
2-
/.idea
3-
Homestead.json
4-
Homestead.yaml
56
.env
7+
.env.backup
68
.phpunit.result.cache
9+
Homestead.json
10+
Homestead.yaml
11+
npm-debug.log
12+
yarn-error.log

.styleci.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,12 @@ php:
22
preset: laravel
33
disabled:
44
- unused_use
5-
js: true
5+
finder:
6+
not-name:
7+
- index.php
8+
- server.php
9+
js:
10+
finder:
11+
not-name:
12+
- webpack.mix.js
613
css: true

README.md

+48-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,61 @@
1-
# Lumen PHP Framework
1+
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
22

3-
[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
4-
[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework)
5-
[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework)
6-
[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework)
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>
79

8-
Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.
10+
## About Laravel
911

10-
## Official Documentation
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:
1113

12-
Documentation for the framework can be found on the [Lumen website](https://lumen.laravel.com/docs).
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)**
1346

1447
## Contributing
1548

16-
Thank you for considering contributing to Lumen! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
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).
1754

1855
## Security Vulnerabilities
1956

20-
If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at [email protected]. All security vulnerabilities will be promptly addressed.
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.
2158

2259
## License
2360

24-
The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
61+
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

app/Anuncios.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Anuncios extends Model
8+
{
9+
protected $primaryKey = 'ida';
10+
protected $fillable = ['ida', 'name','description','url','idt'];
11+
}

app/Console/Kernel.php

+14-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Console;
44

55
use Illuminate\Console\Scheduling\Schedule;
6-
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
77

88
class Kernel extends ConsoleKernel
99
{
@@ -24,6 +24,18 @@ class Kernel extends ConsoleKernel
2424
*/
2525
protected function schedule(Schedule $schedule)
2626
{
27-
//
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');
2840
}
2941
}

app/Events/Event.php

-10
This file was deleted.

app/Events/ExampleEvent.php

-16
This file was deleted.

app/Exceptions/Handler.php

+15-14
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,37 @@
22

33
namespace App\Exceptions;
44

5-
use Illuminate\Auth\Access\AuthorizationException;
6-
use Illuminate\Database\Eloquent\ModelNotFoundException;
7-
use Illuminate\Validation\ValidationException;
8-
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
9-
use Symfony\Component\HttpKernel\Exception\HttpException;
5+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
106
use Throwable;
117

128
class Handler extends ExceptionHandler
139
{
1410
/**
15-
* A list of the exception types that should not be reported.
11+
* A list of the exception types that are not reported.
1612
*
1713
* @var array
1814
*/
1915
protected $dontReport = [
20-
AuthorizationException::class,
21-
HttpException::class,
22-
ModelNotFoundException::class,
23-
ValidationException::class,
16+
//
2417
];
2518

2619
/**
27-
* Report or log an exception.
20+
* A list of the inputs that are never flashed for validation exceptions.
2821
*
29-
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
22+
* @var array
23+
*/
24+
protected $dontFlash = [
25+
'password',
26+
'password_confirmation',
27+
];
28+
29+
/**
30+
* Report or log an exception.
3031
*
3132
* @param \Throwable $exception
3233
* @return void
3334
*
34-
* @throws \Exception
35+
* @throws \Throwable
3536
*/
3637
public function report(Throwable $exception)
3738
{
@@ -43,7 +44,7 @@ public function report(Throwable $exception)
4344
*
4445
* @param \Illuminate\Http\Request $request
4546
* @param \Throwable $exception
46-
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
47+
* @return \Symfony\Component\HttpFoundation\Response
4748
*
4849
* @throws \Throwable
4950
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
use App\Anuncios;
8+
9+
10+
class AnunciosController extends Controller
11+
{
12+
public function index(){
13+
$anuncios = Anuncios::simplePaginate(3);
14+
return view('pages.publicidad', compact('anuncios'));
15+
}
16+
17+
public function store(Request $request){
18+
19+
$image=new Anuncios($request->all());
20+
21+
if ($request->hasFile('url')){
22+
23+
$file = $request->file("url");
24+
//$nombrearchivo = str_slug($request->slug).".".$file->getClientOriginalExtension();
25+
$nombrearchivo = $file->getClientOriginalName();
26+
$file->move(public_path("storage"),$nombrearchivo);
27+
$image->url = 'storage/'.$nombrearchivo;
28+
29+
}
30+
31+
$image->save();
32+
33+
return redirect()->route('publicidad')
34+
->with("<script>
35+
UIkit.notification({
36+
message: 'Success !',
37+
status: 'Success ',
38+
pos: 'bottom-right',
39+
timeout: 10000
40+
});
41+
</script>");
42+
}
43+
}

app/Http/Controllers/Controller.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
namespace App\Http\Controllers;
44

5-
use Laravel\Lumen\Routing\Controller as BaseController;
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;
69

710
class Controller extends BaseController
811
{
9-
//
12+
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
1013
}

app/Http/Controllers/ExampleController.php

-18
This file was deleted.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
use App\Anuncios;
8+
9+
class IndexController extends Controller
10+
{
11+
public function index(){
12+
13+
$anuncios = Anuncios::all();
14+
return view('pages.index',compact('anuncios'));
15+
}
16+
}

0 commit comments

Comments
 (0)