Laravel

Laravel is a free, open-source[3] PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern and based on Symfony. Some of the features of Laravel are a modular packaging system with a dedicated dependency manager, different ways for accessing relational databases, utilities that aid in application deployment and maintenance, and its orientation toward syntactic sugar.

Subjects

Latest Asked Question

45 Likes
A : best view answer echo Request::fullUrl() echo Request::url(); echo Request::path() echo Request::segment(1); echo Request::is("admin/*")
45 Likes
A : hey I was facing the same problem in Laravel 5.4 I found that adding the save method solved the problem. So you can use it I hope it help; Session::put('key', $value); Session::save();
45 Likes
A : First thing need to do i.e install Laravel maatwebsite package for use Excel facade. Just run command as below in composer or girhub bash composer require maatwebsite/excel Then open config/app.php <?php return [....     'providers' => [....         Maatwebsite\Excel\ExcelServiceProvider::class,     ],     'aliases' => [ ....         'Excel' => Maatwebsite\Excel\Facades\Excel::class,     ],    .... And at last here is code for export create new method for controller. /** * Create a new controller instance. * * @return void */ public function exportFile($type){ $products = Product::get()->toArray(); return \Excel::create('download_excel_demo', function($excel) use ($products) { $excel->sheet('sheet name', function($sheet) use ($products) { $sheet->fromArray($products); }); })->download($type); }
45 Likes
A : DOMPDF Wrapper for Laravel 5  Require this package in your composer.json and update composer. This will download the package and the dompdf + fontlib libraries also. Installation :  composer require barryvdh/laravel-dompdf Run above line in github / composer use the facade: $pdf = PDF::loadView('pdf.invoice', $data); return $pdf->download('invoice.pdf');
45 Likes
A : Hi use some thing like this in laravel 5.5 public static function getTotalJobList($employerId = Null) {             $query = self::select('*')                  ->orderBy('candidate', 'desc')                 ->get();          return $query; }   > to get multiple row use above :  public static function getTotalJobList($employerId = Null) {             $query = self::select('*')                  ->orderBy('candidate', 'desc')                 ->first();          return $query; } > If you want to get single row use as above.  
45 Likes
A : Hi use same routes for both get as well as post some thing like as below in laravel 5.5 :  Route::get('/candidates', 'CandidateController@candidates')->name('candidates'); Route::post('/candidates', 'CandidateController@candidates')->name('candidates'); Fully tested and workable.
45 Likes
Laravel Related Topic's