SHARE
TWEET

Untitled

a guest Jun 15th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Route::get('/create',   ['as'=>'creates','uses'=>'CAsController@create2']);
  2.             Route::put('/postca', 'CAsController@storing');
  3.  
  4.  
  5.  
  6.     <?php
  7.  
  8.     namespace AppHttpControllers;
  9.     use AppCAModel;
  10.     use IlluminateHttpRequest;
  11.  
  12.    class CAsController extends Controller
  13.     {
  14.     public function create2(){
  15.     return view('chartered.create');
  16. }
  17. public function storing(Request $request)
  18. {
  19.     // Handle File Upload
  20.     if($request->hasFile('profile')){
  21.         // Get filename with the extension
  22.         $filenameWithExt = $request->file('profile')->getClientOriginalName();
  23.         // Get just filename
  24.         $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
  25.         // Get just ext
  26.         $extension = $request->file('profile')->getClientOriginalExtension();
  27.         // Filename to store
  28.         $fileNameToStore= $filename.'_'.time().'.'.$extension;
  29.         // Upload Image
  30.         $path = $request->file('profile')->storeAs('public/profile', $fileNameToStore);
  31.     } else {
  32.         $fileNameToStore = 'noimage.jpg';
  33.     }
  34.  
  35.  
  36.     // Handle File Upload
  37.     if($request->hasFile('certificate')){
  38.         // Get filename with the extension
  39.         $filenameWithExt1 = $request->file('certificate')->getClientOriginalName();
  40.         // Get just filename
  41.         $filename1 = pathinfo($filenameWithExt1, PATHINFO_FILENAME);
  42.         // Get just ext
  43.         $extension1 = $request->file('certificate')->getClientOriginalExtension();
  44.         // Filename to store
  45.         $fileNameToStore1= $filename1.'_'.time().'.'.$extension1;
  46.         // Upload Image
  47.         $path1 = $request->file('certificate')->storeAs('public/certificate', $fileNameToStore1);
  48.     } else {
  49.         $fileNameToStore1 = 'noimage.jpg';
  50.     }
  51.  
  52.     $ca = new CAModel;
  53.     $ca->fname = $request->input('fname');
  54.     $ca->lastname = $request->input('lastname');
  55.     $ca->username = $request->input('username');
  56.     $ca->city = $request->input('city');
  57.     $ca->state = $request->input('state');
  58.     $ca->zip = $request->input('zip');
  59.     $ca->phone = $request->input('phone');
  60.     $ca->email = $request->input('email');
  61.     $ca->gstno = $request->input('gstno');
  62.     $ca->website = $request->input('website');
  63.     $ca->services = $request->input('services');
  64.     $ca->profile = $fileNameToStore;
  65.     $ca->certificate = $fileNameToStore1;  
  66.     $ca->save();
  67.     return redirect('/postca');
  68. }
  69.      
  70. <p>Register for TaxRx.</p>
  71.         <form method="POST" action="{{route('registered')}}">
  72.           @csrf
  73.           @method('put')
  74.                 <div class="form-group">
  75.                 <input type="text" class="form-control" placeholder="Name" style="text-transform: uppercase;" value="{{Auth::user()->name}}" readonly>
  76.                 </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top