Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nada code branch #2

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a6862b0
Add files via upload
Ndaahlb Jan 4, 2021
b340433
Add files via upload
Ndaahlb Jan 4, 2021
4d6a8a1
Add files via upload
Ndaahlb Jan 4, 2021
5e5893f
Add files via upload
Ndaahlb Jan 4, 2021
df7dac5
Delete ProjectsController.php
Ndaahlb Jan 10, 2021
14b984c
Delete Projects.php
Ndaahlb Jan 10, 2021
cbe4d30
Delete User.php
Ndaahlb Jan 10, 2021
1188ce5
Delete UserFactory.php
Ndaahlb Jan 10, 2021
64f12ec
Delete 2014_10_12_000000_create_users_table.php
Ndaahlb Jan 10, 2021
33ae666
Delete 2014_10_12_100000_create_password_resets_table.php
Ndaahlb Jan 10, 2021
c4e72b7
Delete 2019_08_19_000000_create_failed_jobs_table.php
Ndaahlb Jan 10, 2021
19f5b8f
Delete 2021_01_04_085641_create_projects_table.php
Ndaahlb Jan 10, 2021
acbd60c
Delete DatabaseSeeder.php
Ndaahlb Jan 10, 2021
28fa2f7
Delete welcome.blade.php
Ndaahlb Jan 10, 2021
4cc5ced
Delete web.php
Ndaahlb Jan 10, 2021
121444d
Add files via upload
Ndaahlb Jan 10, 2021
b513005
Add files via upload
Ndaahlb Jan 10, 2021
aa1d674
Add files via upload
Ndaahlb Jan 10, 2021
b81ed6a
Add files via upload
Ndaahlb Jan 10, 2021
e966b88
Add files via upload
Ndaahlb Jan 10, 2021
c108e8c
Add files via upload
Ndaahlb Jan 10, 2021
0a65144
Add files via upload
Ndaahlb Jan 10, 2021
a815e7f
Create resources
Ndaahlb Jan 10, 2021
6cf245a
Delete resources
Ndaahlb Jan 10, 2021
204af8c
Add files via upload
Ndaahlb Jan 10, 2021
421d932
Delete validation.php
Ndaahlb Jan 10, 2021
180a745
Delete auth.php
Ndaahlb Jan 10, 2021
a916b3a
Delete pagination.php
Ndaahlb Jan 10, 2021
5b06287
Delete passwords.php
Ndaahlb Jan 10, 2021
89a6cb9
Delete _variables.scss
Ndaahlb Jan 10, 2021
271ddfa
Delete app.scss
Ndaahlb Jan 10, 2021
ef72ffc
Update show.blade.php
Ndaahlb Jan 11, 2021
47bf274
Update index.blade.php
Ndaahlb Jan 11, 2021
d3adefb
Update postmanController.php
Ndaahlb Jan 11, 2021
2e60567
Update create.blade.php
Ndaahlb Jan 12, 2021
77aaada
Update show.blade.php
Ndaahlb Jan 12, 2021
a10814d
Update and rename mainlayout.blade.php to app.blade.php
Ndaahlb Jan 12, 2021
e8b4b41
Delete welcome.blade.php
Ndaahlb Jan 12, 2021
497930b
Update postmanController.php
Ndaahlb Jan 12, 2021
6dbee7f
Update postmanController.php
Ndaahlb Jan 12, 2021
cdc1117
Update edit.blade.php
Ndaahlb Jan 12, 2021
0b3a614
Update index.blade.php
Ndaahlb Jan 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];

/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
}

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
40 changes: 40 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
}
13 changes: 13 additions & 0 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
115 changes: 115 additions & 0 deletions app/Http/Controllers/postmanController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

namespace App\Http\Controllers;

use App\Models\postman;
use Illuminate\Http\Request;

class postmanController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$postman = postman::all();
return view('postman.index', compact('postman', $postman));
}

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('postman.create');
}

/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate([
'truck_number'=>'required',
'postman_number'=>'required',
'postman_name'=>'required',
'date_of_operation'=>'required'
]);
$postman = postman::create([
'truck_number' => $request->truck_number,
'postman_number' => $request->postman_number,
'postman_name' => $request->postman_name,
'date_of_operation' => $request->date_of_operation
]);
return redirect('postman');

}

/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(postman $postman)
{
return view('postman.show', compact('postman',$postman));
}

/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(postman $postman)
{

return view('postman.edit', compact('postman', $postman));
}

/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, postman $postman)
{
$request->validate([
'truck_number'=>'required',
'postman_number'=>'required',
'postman_name'=>'required',
'date_of_operation'=>'required'
]);
$postman->truck_number = $request->truck_number;
$postman->postman_number = $request->postman_number;
$postman->postman_name = $request->postman_name;
$postman->date_of_operation = $request->date_of_operation;
$postman->save();
$request->session()->flash('message', 'Sucessfully update postman');
return redirect('postman');
}

/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, postman $postman)
{

$postman->delete();
$request->session()->flash('message', 'Sucessfully delete postman');
return redirect('postman');
}
}
66 changes: 66 additions & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];

/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],

'api' => [
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];

/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
}
21 changes: 21 additions & 0 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Auth\Middleware\Authenticate as Middleware;

class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}
17 changes: 17 additions & 0 deletions app/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;

class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}
17 changes: 17 additions & 0 deletions app/Http/Middleware/PreventRequestsDuringMaintenance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;

class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}
32 changes: 32 additions & 0 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Http\Middleware;

use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null ...$guards
* @return mixed
*/
public function handle(Request $request, Closure $next, ...$guards)
{
$guards = empty($guards) ? [null] : $guards;

foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}

return $next($request);
}
}
18 changes: 18 additions & 0 deletions app/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;

class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected $except = [
'password',
'password_confirmation',
];
}
Loading