shahzadyounas

shahzadyounas

Member Since 1 Year Ago

Experience Points 1,450
Experience Level 1

3,550 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

26 Aug
1 year ago

shahzadyounas started a new conversation View Auth.login Not Found And Failed To Open Stream: No Such File Or Directory Error

I upload my laravel site on 000webhost now this error occure

view auth.login not found 

and 
file_put_contents(C:\xampp\htdocs\opms\storage\framework/sessions/dcjpWr3LYUIefyAW1glu3FMnmsJprU8yZl41g4jL): failed to open stream: No such file or directory

i also search all tutorials related to this query but my problem not solved i also change name of config.php to config.php_ and more but not solved

22 Aug
1 year ago

shahzadyounas left a reply on How To Show Mobile# Of Only Male Students In Laravel Blade Table

@foreach($users as $user) {{$i}} {{ $user->reg_number }} {{$user->fname." ". $user->lname}} {{ $user->email }} {{ $user->mobile }}
    <td>

shahzadyounas started a new conversation How To Show Mobile# Of Only Male Students In Laravel Blade Table

I use "gender" attribute in Users table. my users are male and female. i want to show mobile number of only "Male" students in laravel blade view. This is my Code of users.blade.php

      <table>
              <thead>
               <tr>
                <th>Name</th>
                <th>Email</th>
                <th>Mobile</th>
              </tr>
            </thead>
            <tbody>
             @foreach($users as $user)
              <td>{{$user->fname}}</td>
              <td>{{ $user->email }}</td>
              <td>{{ $user->mobile }}</td>// Here how to show only Male Students Mobile No. 
              @endforeach
            </tbody>
          </table>

17 Jun
1 year ago

shahzadyounas left a reply on Password Reset Link Not Working

this is route:list

+--------+-----------+------------------------------+--------------------+------------------------------------------------------------------------+--------------+
| Domain | Method    | URI                          | Name               | Action                                                                 | Middleware   |
+--------+-----------+------------------------------+--------------------+------------------------------------------------------------------------+--------------+
|        | GET|HEAD  | /                            |                    | Closure                                                                | web          |
|        | GET|HEAD  | a                            |                    | Closure                                                                | web          |
|        | GET|HEAD  | addadmin                     |                    | Closure                                                                | web          |
|        | POST      | admin                        | admin.store        | App\Http\Controllers\[email protected]                             | web          |
|        | GET|HEAD  | admin                        | admin.index        | App\Http\Controllers\[email protected]                             | web          |
|        | GET|HEAD  | admin/create                 | admin.create       | App\Http\Controllers\[email protected]                            | web          |
|        | DELETE    | admin/{admin}                | admin.destroy      | App\Http\Controllers\[email protected]                           | web          |
|        | PUT|PATCH | admin/{admin}                | admin.update       | App\Http\Controllers\[email protected]                            | web          |
|        | GET|HEAD  | admin/{admin}                | admin.show         | App\Http\Controllers\[email protected]                              | web          |
|        | GET|HEAD  | admin/{admin}/edit           | admin.edit         | App\Http\Controllers\[email protected]                              | web          |
|        | GET|HEAD  | api/user                     |                    | Closure                                                                | api,auth:api |
|        | GET|HEAD  | course                       | course.index       | App\Http\Controllers\[email protected]                            | web          |
|        | POST      | course                       | course.store       | App\Http\Controllers\[email protected]                            | web          |
|        | GET|HEAD  | course/create                | course.create      | App\Http\Controllers\[email protected]                           | web          |
|        | DELETE    | course/{course}              | course.destroy     | App\Http\Controllers\[email protected]                          | web          |
|        | PUT|PATCH | course/{course}              | course.update      | App\Http\Controllers\[email protected]                           | web          |
|        | GET|HEAD  | course/{course}              | course.show        | App\Http\Controllers\[email protected]                             | web          |
|        | GET|HEAD  | course/{course}/edit         | course.edit        | App\Http\Controllers\[email protected]                             | web          |
|        | GET|HEAD  | department                   | department.index   | App\Http\Controllers\[email protected]                        | web          |
|        | POST      | department                   | department.store   | App\Http\Controllers\[email protected]                        | web          |
|        | GET|HEAD  | department/create            | department.create  | App\Http\Controllers\[email protected]                       | web          |
|        | GET|HEAD  | department/{department}      | department.show    | App\Http\Controllers\[email protected]                         | web          |
|        | PUT|PATCH | department/{department}      | department.update  | App\Http\Controllers\[email protected]                       | web          |
|        | DELETE    | department/{department}      | department.destroy | App\Http\Controllers\[email protected]                      | web          |
|        | GET|HEAD  | department/{department}/edit | department.edit    | App\Http\Controllers\[email protected]                         | web          |
|        | GET|HEAD  | home                         | home               | App\Http\Controllers\[email protected]                              | web,auth     |
|        | POST      | login                        |                    | App\Http\Controllers\Auth\[email protected]                        | web,guest    |
|        | GET|HEAD  | login                        | login              | App\Http\Controllers\Auth\[email protected]                | web,guest    |
|        | POST      | logout                       | logout             | App\Http\Controllers\Auth\[email protected]                       | web          |
|        | POST      | password/email               | password.email     | App\Http\Controllers\Auth\[email protected]  | web,guest    |
|        | POST      | password/reset               |                    | App\Http\Controllers\Auth\[email protected]                | web,guest    |
|        | GET|HEAD  | password/reset               | password.request   | App\Http\Controllers\Auth\[email protected] | web,guest    |
|        | GET|HEAD  | password/reset/{token}       | password.reset     | App\Http\Controllers\Auth\[email protected]        | web,guest    |
|        | POST      | register                     |                    | App\Http\Controllers\Auth\[email protected]                  | web,guest    |
|        | GET|HEAD  | register                     | register           | App\Http\Controllers\Auth\[email protected]      | web,guest    |
|        | GET|HEAD  | supervisor                   | supervisor.index   | App\Http\Controllers\[email protected]                        | web          |
|        | POST      | supervisor                   | supervisor.store   | App\Http\Controllers\[email protected]                        | web          |
|        | GET|HEAD  | supervisor/create            | supervisor.create  | App\Http\Controllers\[email protected]                       | web          |
|        | DELETE    | supervisor/{supervisor}      | supervisor.destroy | App\Http\Controllers\[email protected]                      | web          |
|        | GET|HEAD  | supervisor/{supervisor}      | supervisor.show    | App\Http\Controllers\[email protected]                         | web          |
|        | PUT|PATCH | supervisor/{supervisor}      | supervisor.update  | App\Http\Controllers\[email protected]                       | web          |
|        | GET|HEAD  | supervisor/{supervisor}/edit | supervisor.edit    | App\Http\Controllers\[email protected]                         | web          |
+--------+-----------+------------------------------+--------------------+------------------------------------------------------------------------+--------------+

shahzadyounas left a reply on Password Reset Link Not Working

i use default auth but it is not working

shahzadyounas started a new conversation Password Reset Link Not Working

i send reset password link to gmail account when i click on reset password link then a new link open like this

http://localhost/password/reset/ac5d55591e5772361ec8f384a204d16433325efa38a4415d41221634fd70d7eb

and the page show that Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster.

.env file here

APP_NAME="Online Project Management System"
APP_ENV=local
APP_KEY=base64:GZ+5M4MTuNpmXKcvcsuCz1DaiAI+63V3sG+0DUaWCFU=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=17618
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=*****@gmail.com
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=ssl


PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

08 Jun
1 year ago

shahzadyounas started a new conversation Teacher And Student Table Registered With Same Email. How Fix It

I have three tables "Admin", "Teachers" and "Students", in each table i choose Field "Email" for login on single login panel, i have 2 problems

  1. An email that is already register in second table can be register in other table but i want to be unique email for these three table. which logic i use??
  2. Which method i use that i want to login these three panels using single login form.
05 Jun
1 year ago

shahzadyounas left a reply on Table Show Wrong Id

@casnv18 Thank you so much sir

shahzadyounas started a new conversation Table Show Wrong Id

I have two table "departments" and "Supervisors" and i left joining the tables as following in code

class SupervisorController extends Controller
{
    
    public function index()
    {
       $supervisors = supervisor::leftJoin('departments','supervisors.departmentid','=','departments.id')->get();
       return view('admin.allSupervisor', compact('supervisors'));
    }

i supervisor form i select a department ... in supervisors table the field name of supervisor id is "id" and in departments table the field name of supervisor id is "id" .

My problem is that when i show the data of supervisor then it show the id of department for supervisor instead of supervisor id my DepartmentSelectProvide

<?php
namespace App\Providers;
use App\DepartmentSelect; // write model name here 
use Illuminate\Support\ServiceProvider;

class DepartmentSelectProvider extends ServiceProvider
{
  
    public function boot()
    {
          view()->composer('*',function($view){
          $view->with('departmentsarray', DepartmentSelect::all());
        });
    }


}



and the allSupervisor.blade.php

    
<td >{{$row->id}}</td>   ------->>> here it how id of department table but i want to show supervisor id,,,,
<td>{{$row->fname}}     {{$row['lname']}}</td>
<td>{{$row->email}}</td>
<td>{{$row->password}}</td>
<td>{{$row->departmentname}}</td>   ----- this is come from department table and its right
<td>{{$row->depjdate}}</td>
<td>{{$row->gender}}</td>

04 Jun
1 year ago

shahzadyounas left a reply on "Error: Unknown Column Find", And I Did Not Find It

thnxx now i have a new problem

shahzadyounas left a reply on "Error: Unknown Column Find", And I Did Not Find It

@Cronix Thaks sir but 1 thing tell me.. Can you give me your WhatsApp number..

and i am confused as i have many table in my project and each table have an id ,,, then tell me i should not to change id name??

shahzadyounas started a new conversation "Error: Unknown Column Find", And I Did Not Find It

First of all i say bundles of Thanks to all Members who help me, I wish you may live long and may success in you field...

my question is that

an error is occur in my project that i can not find this is simple error,,, i create table Departments , and first field name ls "depid" when i edit record then its show this error

"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'departments.id' in 'where clause' (SQL: select * from `departments` where `departments`.`id` = 1 limit 1 

i try but i can not find this error ... DepartmentController.php code as follwing

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Department;

class DepartmentController extends Controller
{
  
    public function index()
    {
         $departments=\App\Department::all();
        return view('admin.alldepartment',compact('departments'));
    }

   
    public function create()
    {
          return view('admin.adddepartment');
    }

   
    public function store(Request $request)
    {


        $this->validate($request, [
        'departmentname' => 'required|unique:departments|max:255',
         'depstartdate' => 'required',
        ],
        [

    'departmentname.required' => 'The Department Name field is required.',
    'departmentname.unique' => 'The Department Name has already been taken..',
    'depstartdate.required' => 'The Starting Date field is required.',
        ]);

        $department= new \App\Department;
        $department->departmentname=$request->get('departmentname');
        $department->depstartdate=$request->get('depstartdate');
        $department->save();
        
        return redirect('department')->with('success', 'Information has been added');
    }

    
    public function edit($depid)
    {
         
        $department = \App\Department::find($depid);

        return view('admin.editDepartment',compact('department','depid'));
    }

}

Table code as following

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDepartmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('departments', function (Blueprint $table) {
           
            $table->increments('depid');
            $table->string('departmentname')->unique();
            $table->string('depstartdate');


            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('departments');
    }
}


if you want to see other code then i will be upload after you comment

shahzadyounas left a reply on Show Undefined Variable In Edit Code

the complete code of allDepartment.blade.php is

@extends('admin.layout')

@section('content')
   

                                                   <table class="table table-striped table-bordered table-hover table-checkable order-column valign-middle" id="example4">
                                        <thead>
                                            <tr>
                                                <th>Department ID</th>
                                                <th>Department Name</th>
                                                <th>Creating Date of Department</th>
                            
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                            <tbody>
                                            @foreach($departments as $row)
                                        <tr class="even">
                                                <td >{{$row->depid}}</td>
                                                <td>{{$row->departmentname}}</td>
                                                <td>{{$row->depstartdate}}</td>
                                            
                                                <td>
                     

                          <a href="{{action('[email protected]', $department['depid'])}}" class="" data-toggle="tooltip" title="Edit">
                                                      <i class="fa fa-check">  </i></a>
                          <a href="javascript:void(0)"  class="text-inverse" title="Delete" data-toggle="tooltip">
                                                        <i class="fa fa-trash"></i></a>
                                                </td>
                                            </tr>
                                        
                                            @endforeach
                                            
                                            
                                        </tbody>
                                    </table>
                
                        

   
@endsection

shahzadyounas started a new conversation Show Undefined Variable In Edit Code

This error occur when when i use this in code

"Undefined variable: department (View: C:\xampp\htdocs\besuperior\resources\views\admin\allDepartment.blade.php)"

The error in the following allDepartment.blade.php page

 <a href="{{action('[email protected]', $department ['depid'])}}" class="" data-toggle="tooltip" title="Edit">

and DepartmentController.php is

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Department;

class DepartmentController extends Controller
{
  
    public function index()
    {
         $departments=\App\Department::all();
        return view('admin.alldepartment',compact('departments'));
    }

   
    public function create()
    {
          return view('admin.adddepartment');
    }

   
    public function store(Request $request)
    {


        $this->validate($request, [
        'departmentname' => 'required|unique:departments|max:255',
         'depstartdate' => 'required',
        ],
        [

    'departmentname.required' => 'The Department Name field is required.',
    'departmentname.unique' => 'The Department Name has already been taken..',
    'depstartdate.required' => 'The Starting Date field is required.',
        ]);

        $department= new \App\Department;
        $department->departmentname=$request->get('departmentname');
        $department->depstartdate=$request->get('depstartdate');
        $department->save();
        
        return redirect('department')->with('success', 'Information has been added');
    }

   
    public function show($id)
    {
      
    }

   
    public function edit($id)
    {
         

         $department = \App\Department::find($depid);

        return view('admin.editDepartment',compact('department','depid'));
    }

   
    public function update(Request $request, $id)
    {
      
    }

    public function destroy($id)
    {
       
    }
}

shahzadyounas left a reply on Alert Alert-success Not Showing

please tell me in detail

shahzadyounas started a new conversation Alert Alert-success Not Showing

in home.blade.php

@if(session('response'))
                <div class="alert alert-success">
                    {{session('response')}}
                </div>
            @endif

and in controller the code is

 return redirect('/')-> with ('response', 'Register Successfully');

but the Register Successfully alert not showing, how to fix it

shahzadyounas left a reply on "Date" Field Validation Error

@Cronix you answer is right bit when i use


 'departmentname' => 'required|unique:department|max:255',

the it show alert "The departmentname has already been taken." but i want to show "The Department Name has already exist"

shahzadyounas left a reply on "Date" Field Validation Error

one thing plz tel; me

shahzadyounas left a reply on "Date" Field Validation Error

when i enter duplicate data then it show laravel error

"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Computer Science' for key 'department_departmentname_unique' (SQL: insert into `department` (`departmentname`, `depstartdate`, `updated_at`, `created_at`) values (Computer Science, 04-06-2018, 2018-06-04 07:13:15, 2018-06-04 07:13:15))

but i want to show alert msg

shahzadyounas left a reply on "Date" Field Validation Error

@Snapey , @Cronix @yusuf128 Thanks to all and plz tell me that

if i enter duplicate data then how to show alert alert-danger as showing "Filed is requires"

shahzadyounas left a reply on "Date" Field Validation Error

if i enter duplicate data then how to validate it in store function

shahzadyounas left a reply on "Date" Field Validation Error

what is answer of 1st question,,, i put date in field but validation occur that enter date ??? why

shahzadyounas started a new conversation "Date" Field Validation Error

i have two question.

  1. I put data in both field "Department Name" and "Starting Date" but validation message occur that "The depjdate field is required." Snapshot as following https://prnt.sc/jqhkqs
  2. as you showing in picture the validation show message "The depjdate field is required." but i want to show the message "The Starting Date field is required." addDepartment.blade.php
<form method="POST" action="{{ route('department.store') }}">
  @csrf

<div class="card-body row">

   <div class="col-lg-6 p-t-20"> 
    <div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label txt-full-width">
          <input class = "mdl-textfield__input{{ $errors->has('name') ? ' is-invalid' : '' }}" 
                   name="departmentname" type = "text" id = "txtDepName" value="{{ 
                    old('departmentname') }}">
         @if ($errors->has('departmentname'))
                                    <span class="invalid-feedback">
                                        <strong>{{ $errors->first('departmentname') }}</strong>
                                     </span>
                                   @endif
    <label class = "mdl-textfield__label">Department Name</label>
         </div>
      </div>
                                     

                                        


                                     
<div class="col-lg-6 p-t-20"> 
       <div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label txt-full-width">
              <input class = "mdl-textfield__input{{ $errors->has('depstartdate') ? ' is-invalid' : '' }}" name="depstartdate" type = "text" id = "date" value="{{ old('depstartdate') }}" >
                                               
@if ($errors->has('depstartdate'))
                                    <span class="invalid-feedback">
                                        <strong>{{ $errors->first('depstartdate') }}</strong>
                                    </span>
                                @endif


          <label class = "mdl-textfield__label" >Department Start Date</label>
           </div>
      </div>



        @if ($errors->any())
   <div class="col-md-12 alert alert-danger">
       <ul>
           @foreach ($errors->all() as $error)
               <li>{{ $error }}</li>
           @endforeach
       </ul>
   </div>
 @endif
                                       
                                        
   <div class="col-lg-12 p-t-20 text-center"> 
            <button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect m-b-10 m-r-20 btn-pink">Submit</button>
            <button type="reset" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect m-b-10 btn-default">Reset</button>
      </div>
 </form>

The DepartmentController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Department;

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

    }

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

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $this->validate($request, [
        'departmentname' => 'required',
        'depjdate' => 'required',
        ]);

        $s = new Department();
        $s->departmentname = $request->departmentname;
        $s->depstartdate = $request->depstartdate;
       
        $s->save();
        return redirect("department");
    }


}


And The table code as following:

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddDepartmentToTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
         Schema::create('department', function (Blueprint $table) {

            $table->increments('depid');
            $table->string('departmentname')->unique();
            $table->date('depstartdate');
            $table->rememberToken();
            $table->timestamps();
            });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('department', function (Blueprint $table) {
    
        });
    }
}

shahzadyounas left a reply on Record Not Showing In Table Of PhpMyAdmin Database

all table and there fields showing but only records not showing

03 Jun
1 year ago

shahzadyounas started a new conversation Record Not Showing In Table Of PhpMyAdmin Database

i download this project from github

https://github.com/dadokps/Laravel-5.4-Student-Management-System

in this project the there is no record in all tables? how i can retrieve records from this project i did't how to do it because i m new in laravel

shahzadyounas left a reply on How To Open Downloaded Laravel Projects From GITHUB On Localhost XAMPP

how to import database records in this project

shahzadyounas started a new conversation Hoe Ti Import And Export Database In Laravel

i have five table with 100 students records... how to export this records and then how to again import it in xampp localhost

31 May
1 year ago

shahzadyounas started a new conversation SQLSTATE[42S02]: Base Table Or View Not Found

My project and database name is "opms" when o store data then error occur

"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'opms.department' doesn't exist (SQL: select * from `department`)"

controller is

 public function store(Request $request)
    {
        
          
        
        $s = new Supervisor();
        $s->fname = $request->fname;
        $s->lname = $request->lname;
        $s->departmentid = $request->departmentid;
        $s->username= $request->username;
        $s->password = $request->password;
        $s->jdate= $request->jdate;
        $s->gender = $request->gender;
        
        $s->save();

    }

shahzadyounas left a reply on General Error: 1364 Field 'image' Doesn't Have A Default Value

@Sergiu17 My project name is opms..and department is name of table, this error occur how to fix

"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'opms.department' doesn't exist (SQL: select * from `department`)"

shahzadyounas left a reply on General Error: 1364 Field 'image' Doesn't Have A Default Value

@Sergiu17 plz give me step by step command to remigrate

shahzadyounas left a reply on General Error: 1364 Field 'image' Doesn't Have A Default Value

@Snapey i changed it as you say, but it giving same error again .

shahzadyounas started a new conversation General Error: 1364 Field 'image' Doesn't Have A Default Value

I design many field for "Supervisor" Table, in admin panel as following:

    public function up()
    {
        Schema::create('supervisor', function (Blueprint $table) {

            $table->increments('supid');
            $table->string('fname');
            $table->string('lname');
            $table->string('departmentid');
             $table->string('username');
            $table->string('password');
            $table->string('mobile');
             $table->string('email')->default('');
            $table->string('jdate');
            $table->enum('gender',['Male','Female']);
            $table->binary('image') ; 
           $table->string('education');
           $table->string('researchareas');
           $table->string('address');
            $table->rememberToken();
            $table->timestamps();

        });
    }

i want to put data only in some fields, as

public function store(Request $request)
    {
        
          //dd($request->all());

        // validator
        
        $s = new Supervisor();
        $s->fname = $request->fname;
        $s->lname = $request->lname;
        $s->departmentid = $request->departmentid;
        $s->username= $request->username;
        $s->password = $request->password;
        $s->jdate= $request->jdate;
        $s->gender = $request->gender;
        
        $s->save();

    }

When i put data and click on submit button the this error occur.

"SQLSTATE[HY000]: General error: 1364 Field 'image' doesn't have a default value (SQL: insert into `supervisor` (`fname`, `lname`, `departmentid`, `username`, `password`, `jdate`, `gender`, `updated_at`, `created_at`) values (Shahzad, Raza, , Shahzad, 12345, 01-06-2018, Male, 2018-05-31 22:23:54, 2018-05-31 22:23:54)) "

How to fix it???

28 May
1 year ago

shahzadyounas left a reply on I Want To Get Full Structure Of Laravel CMS Site

I want to get complete project . You can give me link from GitHub

shahzadyounas started a new conversation I Want To Get Full Structure Of Laravel CMS Site

In my project there are 3 panels. So I want to get a project that have 3 panels like. Admin . Teacher and studensts. Plz give me link of like this project. And also write steps to open these project in laravel. Thank you so much.

shahzadyounas started a new conversation Trying To Get Property 'id' Of Non-object - How To Fix

My project working well, but suddenly i got an error when i add data in from and submit .

Trying to get property 'id' of non-object (View: C:\xampp\htdocs\opms1\resources\views\admin\allDepartment.blade.php)"
''

blade code is

                        <td ><?php echo e($row->id); ?></td>
                                                <td><?php echo e($row->departmentname); ?></td>
                                                <td><?php echo e($row->depstartdate); ?></td>

this is department controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Department;

class DepartmentController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $depart= Department::all()->toArray();
        return view('admin.allDepartment', compact('depart'));

    }

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

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        
        $s = new Department();
        $s->departmentname = $request->departmentname;
        $s->depstartdate = $request->depstartdate;
       
        $s->save();
        return redirect("department");
    }

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

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        $editdepart= department::find($id);
        return view ('admin.editDepartment', compact('editdepart'));

    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

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

and this is migrate table code

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddDepartmentToTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
         Schema::create('department', function (Blueprint $table) {

            $table->increments('id');
            $table->string('departmentname')->unique();
            $table->string('depstartdate');
            $table->rememberToken();
            $table->timestamps();
            });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('department', function (Blueprint $table) {
    
        });
    }
}


shahzadyounas left a reply on Trying To Get Property 'id' Of Non-object

this is department controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Department;

class DepartmentController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $depart= Department::all()->toArray();
        return view('admin.allDepartment', compact('depart'));

    }

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

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        
        $s = new Department();
        $s->departmentname = $request->departmentname;
        $s->depstartdate = $request->depstartdate;
       
        $s->save();
        return redirect("department");
    }

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

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        $editdepart= department::find($id);
        return view ('admin.editDepartment', compact('editdepart'));

    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

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

and this is migrate table code

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddDepartmentToTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
         Schema::create('department', function (Blueprint $table) {

            $table->increments('id');
            $table->string('departmentname')->unique();
            $table->string('depstartdate');
            $table->rememberToken();
            $table->timestamps();
            });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('department', function (Blueprint $table) {
    
        });
    }
}


shahzadyounas started a new conversation Trying To Get Property 'id' Of Non-object

My project working well, but suddenly i got an error when i add data in from and submit .

"Trying to get property 'id' of non-object (View: C:\xampp\htdocs\opms1\resources\views\admin\allDepartment.blade.php)"

my code is

  <tr class="even">
                                                <td ><?php echo e($row->id); ?></td>
                                                <td><?php echo e($row->departmentname); ?></td>
                                                <td><?php echo e($row->depstartdate); ?></td>
                                            

27 May
1 year ago

shahzadyounas left a reply on New Laravel Project Not Run

i install xampp in D drive, then this error occur now i install Xampp in C drive, now error is removed,,,,, what is its cause?

shahzadyounas started a new conversation New Laravel Project Not Run

When i create new laravel project and run it this it show error.

Warning: require(D:\xampp\htdocs\project\public/../vendor/autoload.php): failed to open stream: No such file or directory in D:\xampp\htdocs\project\public\index.php on line 24

Fatal error: require(): Failed opening required 'D:\xampp\htdocs\project\public/../vendor/autoload.php' (include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\project\public\index.php on line 24

and when i update composer as "composer update" the following error occur

 [RuntimeException]
  Failed to clone https://github.com/sebastianbergmann/phpunit.git, git was not found, check that it is installed and
   in your PATH env.

  'git' is not recognized as an internal or external command,
  operable program or batch file.


06 May
1 year ago

shahzadyounas left a reply on Laravel Documentation Offline Version?

@Sergiu17 This topic is separate from the previous topic so i create a new thread,,,,

shahzadyounas started a new conversation Laravel Documentation Offline Version?

Where i can get laravel documentation offline version for pc

shahzadyounas started a new conversation Best Book For Learning Laravel

I am new in and i want to learn laravel within 30 day completely then tell me What is the best book (free) and also best site for learning laravel. and also share links for book and sites Thanks